Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(871)

Unified Diff: base/nix/xdg_util.cc

Issue 550173006: Do not rely on XDG_CURRENT_DESKTOP only when testing for Unity. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/nix/xdg_util.cc
diff --git a/base/nix/xdg_util.cc b/base/nix/xdg_util.cc
index e889b5681a035b987ecf9e9118a5dece378cc0f3..e2a48d4b938f0b6827527d8a2ec55b2519a118a2 100644
--- a/base/nix/xdg_util.cc
+++ b/base/nix/xdg_util.cc
@@ -57,10 +57,18 @@ DesktopEnvironment GetDesktopEnvironment(Environment* env) {
std::string xdg_current_desktop;
if (env->GetVar("XDG_CURRENT_DESKTOP", &xdg_current_desktop)) {
// Not all desktop environments set this env var as of this writing.
- if (xdg_current_desktop == "Unity")
+ if (xdg_current_desktop == "Unity") {
+ // gnome-fallback sessions set XDG_CURRENT_DESKTOP to Unity
+ // DESKTOP_SESSION can be gnome-fallback or gnome-fallback-compiz
+ std::string desktop_session;
+ if (env->GetVar("DESKTOP_SESSION", &desktop_session) &&
+ desktop_session.find("gnome-fallback") != std::string::npos) {
+ return DESKTOP_ENVIRONMENT_GNOME;
+ }
return DESKTOP_ENVIRONMENT_UNITY;
- else if (xdg_current_desktop == "GNOME")
+ } else if (xdg_current_desktop == "GNOME") {
return DESKTOP_ENVIRONMENT_GNOME;
+ }
}
// DESKTOP_SESSION was what everyone used in 2010.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698