Bug 25941

Summary: xdg-open does not detect xfce
Product: Portland Reporter: Leonid Evdokimov <leon+freedesktop>
Component: xdg-utilsAssignee: Fathi Boudra <fabo>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: fabo, ht990332
Version: unspecified   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: better logic for DE detection

Description Leonid Evdokimov 2010-01-07 08:41:20 UTC
Created attachment 32508 [details] [review]
better logic for DE detection

I use xdg-utils-1.0.2, xfce-4.6.1 and xdg-open does not detect XFCE properly. xdg-open uses following logic:

> if xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;

and, if I run xprop, I see following:

$ xprop -root _DT_SAVE_MODE
_DT_SAVE_MODE:  no such atom on any window.

I've written trivial patch, that works for me, it's attached.

I added some logic for gnome as every gnome installation I see has following environment variable:
GNOME_DESKTOP_SESSION_ID=this-is-deprecated

Also, I am not sure if additional logic for KDE makes sense.
Comment 1 Harry 2011-01-24 02:15:48 UTC
This only occurs when xfce4-session is compiled with '--disable-legacy-sm', which is not default. When legacy support is disabled, _DT_SAVE_MODE and _DT_RESTORE_MODE  are not set.

Nonetheless, it would be best to check against DESKTOP_SESSION at the least.
Comment 2 elam 2011-03-04 10:55:15 UTC
Guys, I do not agree with detection based on environment variable.

I use archlinux with xfce 4.8 
--disable-legacy-sm is used for xfce4-session.

My login manager is LXDM (built from git), and it sets :

[eugene@el-vaio ~]$ set | grep DESKTOP
DESKTOP_SESSION='Xfce Session'

So condition proposed in patch:
elif [ x"$DESKTOP_SESSION" = x"xfce" ]; then DE=xfce;

won't work for me.

Find other way to detect XFCE with --disable-legacy-sm:

[eugene@el-vaio ~]$ xprop -root | grep -i "xfce"
XFCE_DESKTOP_WINDOW(WINDOW): window id # 0x1400003

I propose this:
elif [ x"$(xprop -root| grep -i 'xfce_desktop_window')" != x"" ]; then DE=xfce;
Comment 3 Rex Dieter 2011-04-14 07:35:12 UTC
Thanks, incorporated the ideas here into git.  See also related bug #33321

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.