GNOME Bugzilla – Bug 727546
gdm-session: support XDG_CURRENT_DESKTOP
Last modified: 2014-04-23 18:00:05 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.
Created attachment 273531 [details] [review] gdm-session: support XDG_CURRENT_DESKTOP Set XDG_CURRENT_DESKTOP when DesktopNames is set in the session file.
so we already set GDMSESSION, DESKTOP_SESSION, and XDG_SESSION_DESKTOP. how does this forth one fit into the picture, versus the other three ?
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).
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
Created attachment 273547 [details] [review] gdm-session: support XDG_CURRENT_DESKTOP Set XDG_CURRENT_DESKTOP when DesktopNames is set in the session file.
Review of attachment 273547 [details] [review]: k
Attachment 273547 [details] pushed as af384da - gdm-session: support XDG_CURRENT_DESKTOP
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.
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.