summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Trevisan (TreviƱo) <mail@3v1n0.net>2020-03-31 18:13:46 +0000
committerMarco Trevisan <mail@3v1n0.net>2020-04-01 03:58:56 +0000
commit768c08ba9d6b66dc5289ab5ee7356c1f991e10f5 (patch)
treec6679abd153b165a5a0bc7c5fc908587f2d6712c
parent69426cbfdacca6450c1450745a6ba5b844789e9b (diff)
downloadgnome-shell-cherry-pick-a0def239.tar.gz
main: Don't override DesktopAppInfo desktop if already GNOMEcherry-pick-a0def239
During the shell initialization we call the (deprecated) function to override the Desktop environment in Gio DesktopAppInfo to make sure that applications are correctly shown (as per commit b2fbf5a2), however this might break the cases in which $XDG_CURRENT_DESKTOP is already set and contains GNOME (given that is now a list). In Ubuntu this is in fact set to: ubuntu:GNOME. Now, if an application contains NotShowIn=ubuntu, the key will be ignored by the shell, and the application is still listed everywhere. So, override the DesktopAppInfo desktop environment only in the case that the current desktop is not already GNOME. At the current date I think we could just safely get rid of this override at all, but there could be still cases where it still might be useful, like when running as nested in some other environment, so keeping it. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1156 (cherry picked from commit a0def239408b389020c8d2dc634ab0250e2d9721)
-rw-r--r--js/ui/main.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/js/ui/main.js b/js/ui/main.js
index ebf9b333a..bb579c347 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -132,7 +132,9 @@ function start() {
notifyError(msg, detail);
});
- Gio.DesktopAppInfo.set_desktop_env('GNOME');
+ let currentDesktop = GLib.getenv('XDG_CURRENT_DESKTOP');
+ if (!currentDesktop || !currentDesktop.split(':').includes('GNOME'))
+ Gio.DesktopAppInfo.set_desktop_env('GNOME');
sessionMode = new SessionMode.SessionMode();
sessionMode.connect('updated', _sessionUpdated);