GNOME Bugzilla – Bug 356179
The test in Orca to determine if the desktop is running, isn't working.
Last modified: 2006-09-15 22:17:55 UTC
There is code in Orca that is used to test if the GNOME desktop is running. Unfortunately it's not working. Take the following small script: ---- % cat testifdesktop.py desktopRunning = False try: import gtk desktopRunning = True except: pass print "desktopRunning is: ", desktopRunning ---- Run with: % python testifdesktop.py You will get: desktopRunning is: True printed irrespective of whether you are logged into the desktop or not. If you are not logged into the desktop, you will also get the line: WARNING: could not open display.
Eeks. This definitely used to fail, but I wonder if it's because we were developing on GNOME 2.15 and they had something enabled to force warnings into failures? In any case, maybe replace "desktopRunning=True" with this: desktopRunning = gtk.gdk.display_get_default() I think display_get_default will return None if the display cannot be accessed. Can you give this a shot?
Thanks Will. This seems to work: ---- desktopRunning = False try: import gtk if gtk.gdk.display_get_default(): desktopRunning = True except: pass print "desktopRunning is: ", desktopRunning ---- Creating a patch now...
Created attachment 72878 [details] [review] Patch to fix the problem.
Change checked into CVS HEAD.