Bug 529287

Summary: gnome updates
Product: [Fedora] Fedora Reporter: Matthias Clasen <mclasen>
Component: xdg-utilsAssignee: Rex Dieter <rdieter>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: pertusus, rdieter
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-10-16 17:27:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 473302    

Description Matthias Clasen 2009-10-15 23:47:48 UTC
When xdg-open thinks that it runs in a gnome session, it uses gnome-open. 
There is two problems here: 

- In the last few gnome releases, gvfs-open is the commandline tool of choice.

- The way the gnome session detection works is by looking for a GNOME_DESKTOP_SESSION_ID env var. This does still work with current gnome-session, but the variable is set to 'this-is-deprecated'. A better way to detect a gnome session nowadays is to look for org.gnome.SessionManager on the session bus.

Comment 1 Rex Dieter 2009-10-16 00:31:04 UTC
I've been meaning to ask you about stuff like that and you pre-empted me.  Thanks!

I'll make sure these fixes land soon.

Comment 2 Rex Dieter 2009-10-16 00:38:54 UTC
Do you offhand when support for gvfs-open and org.gnome.SessionManager landed in gnome?  and whether support for the deprecated items can (or should) be dropped?

Otherwise, I suppose we could just be safe and try the new methods, and fallback to the older ones on failure.

Comment 3 Matthias Clasen 2009-10-16 03:18:02 UTC
gvfs-open appeared in 2.22, I think and the session manager dbus interface in 2.24. But I don't think dropping the old ways of doing things is necessary. You can just look for gvfs-open and prefer it over gnome-open if found.

For the gnome detection, looking for the dbus interface is preferable over the env var, since e.g things that are activated on the session bus will not have the deprecated env var in their environment, I think. If any such activated app were to use xdg-open, it would not realize it was running under gnome.

Comment 4 Rex Dieter 2009-10-16 16:00:09 UTC
OK, my dbus-send-fu is a bit lacking, but would checking output or error code of something like the following suffice as a good check for org.gnome.SessionManager existing on the bus:

dbus-send --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager org.freedesktop.DBus.Introspectable.Introspect

?

Comment 5 Rex Dieter 2009-10-16 17:04:25 UTC
better suggestion on irc:
[11:16] <walters> rdieter: dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager

Comment 6 Rex Dieter 2009-10-16 17:27:26 UTC
* Fri Oct 16 2009 Rex Dieter <rdieter> - 1.0.2-14.20091016cvs
- prefer gvfs-open over gnome-open (#529287)
- DE=gnome, if org.gnome.SessionManager exists on dbus (#529287)