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 727546 - gdm-session: support XDG_CURRENT_DESKTOP
gdm-session: support XDG_CURRENT_DESKTOP
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2014-04-03 14:16 UTC by Lars Karlitski
Modified: 2014-04-23 18:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdm-session: support XDG_CURRENT_DESKTOP (2.60 KB, patch)
2014-04-03 14:16 UTC, Lars Karlitski
reviewed Details | Review
gdm-session: support XDG_CURRENT_DESKTOP (2.69 KB, patch)
2014-04-03 19:53 UTC, Bastien Nocera
committed Details | Review

Description Lars Karlitski 2014-04-03 14:16:17 UTC
We just specified XDG_CURRENT_DESKTOP at the freedesktop summit as a way for
desktop components to find out the name of the currently running session.

This variable needs to be set by gdm so that it's in the environment of all
things in the session, most importantly dbus.
Comment 1 Lars Karlitski 2014-04-03 14:16:20 UTC
Created attachment 273531 [details] [review]
gdm-session: support XDG_CURRENT_DESKTOP

Set XDG_CURRENT_DESKTOP when DesktopNames is set in the session file.
Comment 2 Ray Strode [halfline] 2014-04-03 14:32:01 UTC
so we already set GDMSESSION, DESKTOP_SESSION, and XDG_SESSION_DESKTOP.  how does this forth one fit into the picture, versus the other three ?
Comment 3 Allison Karlitskaya (desrt) 2014-04-03 14:46:47 UTC
XDG_CURRENT_DESKTOP is already in wide use outside of GNOME and has a meaning with respect to at least the desktop entry spec (and very soon, some agreed-upon changes to the mimeapp spec).

I also want to use it from gsettings for allowing changes to default values on a per-desktop basis.  This is something that Debarshi wanted for gnome-classic mode and something that distributors have been asking about for a while as well (ie: Ubuntu wants some things different in Unity desktops vs. GNOME desktops -- right now they have to break GNOME in order to make the changes in Unity).
Comment 4 Ray Strode [halfline] 2014-04-03 19:48:09 UTC
Review of attachment 273531 [details] [review]:

not sure about this, but certainly not going to stand in the way

::: daemon/gdm-session.c
@@ +2252,3 @@
+        filename = g_strdup_printf ("%s.desktop", get_session_name (self));
+        keyfile = load_key_file_for_file (filename, NULL);
+        if (keyfile) {

please add != NULL

@@ +2256,3 @@
+
+              names = g_key_file_get_string_list (keyfile, G_KEY_FILE_DESKTOP_GROUP,
+                                                  "DesktopNames", NULL, NULL);

i think you need to check for NULL here?

@@ +2320,3 @@
 
+        desktop_names = get_session_desktop_names (self);
+        if (desktop_names != NULL)

braces
Comment 5 Bastien Nocera 2014-04-03 19:53:14 UTC
Created attachment 273547 [details] [review]
gdm-session: support XDG_CURRENT_DESKTOP

Set XDG_CURRENT_DESKTOP when DesktopNames is set in the session file.
Comment 6 Ray Strode [halfline] 2014-04-03 20:04:52 UTC
Review of attachment 273547 [details] [review]:

k
Comment 7 Bastien Nocera 2014-04-03 20:09:52 UTC
Attachment 273547 [details] pushed as af384da - gdm-session: support XDG_CURRENT_DESKTOP
Comment 8 Lennart Poettering 2014-04-23 15:05:43 UTC
Hmm, so logind since 209 actually understands a session property XDG_SESSION_DESKTOP that may be set to "kde" or "gnome" or suchlike, and appears remarkable close to XDG_CURRENT_DESKTOP. 

http://cgit.freedesktop.org/systemd/systemd/commit/?id=a4cd87e9dce6d38846f23d44df9e21f322f946df

This really sounds like something to unify. Given that XDG_SESSION_DESKTOP already exists in released code, can I convince you to maybe check the spec to name it like this?

Sorry that I didn't notice earlier.
Comment 9 Lennart Poettering 2014-04-23 18:00:05 UTC
After discussing this with a couple of folks on IRC, I think it makes sense to keep XDG_SESSION_DESKTOP and XDG_CURRENT_DESKTOP separate, though make sure they use the same vocabulary for values.

XDG_SESSION_DESKTOP is a single item, that indicates the desktop used on a specific session, and may be used to recognize which sessions of a user are of the same desktop implementation.

XDG_CURRENT_DESKTOP otoh takes a list of compatible desktop identifiers, used for checking what to show of .desktop file entries.

To speak in terms of a packaging manager, one would be similar to a the package name, while the other would be the provides field of a package...

I will document for logind now that its XDG_SESSION_DESKTOP value vocabulary should be kept in sync with XDG_CURRENT_DESKTOP.