From: Cheng Zhao Date: Fri, 17 Oct 2014 08:04:35 +0000 (+0800) Subject: Still requires unity for global app menubar X-Git-Tag: v0.18.1~3 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=ae76657e17a32dba1a8da22e63ee8d76b1ae418c;p=electron.git Still requires unity for global app menubar Fixes #709 and atom/atom#3854. --- diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 664ab50d..75884e5d 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -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 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