diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 60eb70a71c5e..dde5c57f589c 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -67,9 +67,12 @@ 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". scoped_ptr env(base::Environment::Create()); - return unity::IsRunning() && (base::nix::GetDesktopEnvironment(env.get()) == - base::nix::DESKTOP_ENVIRONMENT_UNITY); + std::string name; + return env && env->GetVar("UBUNTU_MENUPROXY", &name) && + !name.empty() && name != "0"; } #endif