7009: endless exception loop starting w/o DISPLAY
constfunc.has_display() was using check_init(), which, on Gtk3, was happy to initalize even that the display was N/A. Amended the test with an attempt to actually get the Gdk default display. svn: r22909
This commit is contained in:
parent
405db681a6
commit
68ed5a2838
@ -132,15 +132,15 @@ def has_display():
|
|||||||
temp, sys.argv = sys.argv, sys.argv[:1]
|
temp, sys.argv = sys.argv, sys.argv[:1]
|
||||||
try:
|
try:
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
|
from gi.repository import Gdk
|
||||||
except:
|
except:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
test = Gtk.init_check(temp)
|
test = Gtk.init_check(temp) and \
|
||||||
|
Gdk.Display.get_default()
|
||||||
sys.argv = temp
|
sys.argv = temp
|
||||||
if test:
|
return bool(test)
|
||||||
return True
|
|
||||||
else:
|
|
||||||
return False
|
|
||||||
except:
|
except:
|
||||||
sys.argv = temp
|
sys.argv = temp
|
||||||
return False
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user