Skip to content

Commit 8672ee5

Browse files
committed
fix gui display
1 parent 15f9a8b commit 8672ee5

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/init.jl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ function find_backend(matplotlib::Py)
4747
:qt5=>"Qt5Agg", :qt=>"Qt4Agg",:tk=>"TkAgg")
4848
if Sys.islinux()
4949
guis = [:tk, :gtk3, :gtk, :qt5, :qt4, :wx]
50-
elseif Sys.isapple()
51-
guis = [:qt5, :qt4, :wx, :gtk, :gtk3, :tk] # issue #410
5250
else
5351
guis = [:tk, :qt5, :qt4, :wx, :gtk, :gtk3]
5452
end
@@ -84,7 +82,8 @@ function find_backend(matplotlib::Py)
8482
ENV["DISPLAY"]
8583
end
8684

87-
if gui == :default
85+
global gui
86+
if gui === :default
8887
# try to ensure that GUI both exists and has a matplotlib backend
8988
for (g,b) in options
9089
if g == :none # Matplotlib is configured to be non-interactive
@@ -158,9 +157,6 @@ function __init__()
158157
# workaround JuliaLang/julia#8925
159158
global backend = backend_gui[1]
160159
global gui = backend_gui[2]
161-
if Sys.isapple() && gui == :tk
162-
@warn "PythonPlot is using tkagg backend, which is known to cause crashes on MacOS (#410); use the MPLBACKEND environment variable to request a different backend."
163-
end
164160

165161
PythonCall.pycopy!(plt, pyimport("matplotlib.pyplot")) # raw Python module
166162
PythonCall.pycopy!(Gcf, pyimport("matplotlib._pylab_helpers").Gcf)

src/pygui.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# global variable to specify default GUI toolkit to use
1010
gui = :default # one of :default, :wx, :qt, :tk, or :gtk
1111

12-
pyexists(mod::AbstractString) = pyconvert(Bool, pyimport("importlib").util.find_spec(mod) == Py(nothing))
12+
pyexists(mod::AbstractString) = pyconvert(Bool, pyimport("importlib").util.find_spec(mod) != Py(nothing))
1313

1414
pygui_works(gui::Symbol) = gui == :default ||
1515
((gui == :wx && pyexists("wx")) ||

0 commit comments

Comments
 (0)