After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 356179 - The test in Orca to determine if the desktop is running, isn't working.
The test in Orca to determine if the desktop is running, isn't working.
Status: RESOLVED FIXED
Product: orca
Classification: Applications
Component: general
1.0.x
Other All
: Normal major
: ---
Assigned To: Rich Burridge
Orca Maintainers
Depends on:
Blocks: 340849
 
 
Reported: 2006-09-15 21:04 UTC by Rich Burridge
Modified: 2006-09-15 22:17 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Patch to fix the problem. (479 bytes, patch)
2006-09-15 22:15 UTC, Rich Burridge
none Details | Review

Description Rich Burridge 2006-09-15 21:04:29 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.
Comment 1 Willie Walker 2006-09-15 21:48:09 UTC
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?
Comment 2 Rich Burridge 2006-09-15 22:09:43 UTC
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...

Comment 3 Rich Burridge 2006-09-15 22:15:15 UTC
Created attachment 72878 [details] [review]
Patch to fix the problem.
Comment 4 Rich Burridge 2006-09-15 22:17:55 UTC
Change checked into CVS HEAD.