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]
|
||||
try:
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
except:
|
||||
return False
|
||||
|
||||
try:
|
||||
test = Gtk.init_check(temp)
|
||||
test = Gtk.init_check(temp) and \
|
||||
Gdk.Display.get_default()
|
||||
sys.argv = temp
|
||||
if test:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
return bool(test)
|
||||
except:
|
||||
sys.argv = temp
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user