Bug 98680 - xdg-utils detectDE() fails to handle XDG_CURRENT_DESKTOP properly
Summary: xdg-utils detectDE() fails to handle XDG_CURRENT_DESKTOP properly
Status: RESOLVED MOVED
Alias: None
Product: Portland
Classification: Unclassified
Component: xdg-utils (show other bugs)
Version: 1.1.0
Hardware: Other All
: medium normal
Assignee: Rex Dieter
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-11 02:32 UTC by Michael Catanzaro
Modified: 2019-02-16 13:38 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Michael Catanzaro 2016-11-11 02:32:23 UTC
$XDG_CURRENT_DESKTOP is a list, not a single value. It could be, for instance, Endless:GNOME or Unity:GNOME, something like that. In cases like these, detectDE() in xdg-utils-common.in fails to parse $XDG_CURRENT_DESKTOP properly, since it's only expecting one single value.

This is not really a serious issue now because detectDE() has a fallback to check $GNOME_DESKTOP_SESSION_ID, but that variable is always set to this-is-deprecated nowadays and could conceivably disappear in the future. That could break desktop detection in desktops that want to be treated as GNOME by xdg-utils. It'd probably be a good idea to use a glob to see if GNOME (or any other desktop) appears anywhere in the list in the case statement at the start of detectDE() to avoid this.
Comment 1 Rex Dieter 2016-11-23 15:43:16 UTC
Dang, kinda wish I'd thoroughly read the related spec(s) before implementing support for it.

I'll have to think on it a bit, but your glob suggestion sounds appealing.
Comment 2 Rex Dieter 2016-11-23 15:50:15 UTC
For posterity,

https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
mentioned in OnlyShowIn/NotShowIn section,
"...If $XDG_CURRENT_DESKTOP is set then it contains a colon-separated list of strings. In order, each string is considered."

https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-latest.html
...the environment variable $XDG_CURRENT_DESKTOP, which is a colon-separated list of names that the current desktop is known as."
Comment 3 GitLab Migration User 2019-02-16 13:38:20 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xdg/xdg-utils/issues/102.


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.