]> khamidou — GitHub mirrors - electron.git/commitdiff
Still requires unity for global app menubar
authorCheng Zhao <zcbenz@gmail.com>
Fri, 17 Oct 2014 08:04:35 +0000 (16:04 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 17 Oct 2014 08:06:45 +0000 (16:06 +0800)
Fixes #709 and atom/atom#3854.

atom/browser/native_window_views.cc

index 664ab50db455ac2ee4b3ef67180a268b1c7ec3dd..75884e5d710fdc996f3a0ed8f121a23a3dab8f7f 100644 (file)
@@ -67,11 +67,13 @@ int kWindowsCreated = 0;
 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" (not 0 or 1)
   scoped_ptr<base::Environment> env(base::Environment::Create());
-  std::string name;
-  return env && env->GetVar("UBUNTU_MENUPROXY", &name) && name.length() > 1;
+  bool is_unity = unity::IsRunning() &&
+                  base::nix::GetDesktopEnvironment(env.get()) ==
+                      base::nix::DESKTOP_ENVIRONMENT_UNITY;
+  std::string menu_proxy;
+  return is_unity && env->GetVar("UBUNTU_MENUPROXY", &menu_proxy) &&
+         menu_proxy.length() > 1;
 }
 #endif