]> khamidou — GitHub mirrors - electron.git/commitdiff
linux: GlobalMenu: UBUNTU_MENUPROXY with >1 char
authorMatthieu Baerts <matttbe@gmail.com>
Wed, 15 Oct 2014 12:17:18 +0000 (14:17 +0200)
committerMatthieu Baerts <matttbe@gmail.com>
Wed, 15 Oct 2014 12:17:18 +0000 (14:17 +0200)
When testing if $UBUNTU_MENUPROXY is set, we should also check if it
contains more than one character. Avoid cases when $UBUNTU_MENUPROXY is
set to 0 or 1.

atom/browser/native_window_views.cc

index 2c0dea85dba2b60e2107b7cdeca4b496e4335090..664ab50db455ac2ee4b3ef67180a268b1c7ec3dd 100644 (file)
@@ -68,11 +68,10 @@ bool ShouldUseGlobalMenuBar() {
   // Some DE would pretend to be Unity but don't have global application menu,
   // so we can not trust unity::IsRunning().
   // When Unity's GlobalMenu is running $UBUNTU_MENUPROXY should be set to
-  // something like "libappmenu.so".
+  // something like "libappmenu.so" (not 0 or 1)
   scoped_ptr<base::Environment> env(base::Environment::Create());
   std::string name;
-  return env && env->GetVar("UBUNTU_MENUPROXY", &name) &&
-         !name.empty() && name != "0";
+  return env && env->GetVar("UBUNTU_MENUPROXY", &name) && name.length() > 1;
 }
 #endif