From ae76657e17a32dba1a8da22e63ee8d76b1ae418c Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 17 Oct 2014 16:04:35 +0800 Subject: [PATCH] Still requires unity for global app menubar Fixes #709 and atom/atom#3854. --- atom/browser/native_window_views.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 -- 2.43.0