Still requires unity for global app menubar

Fixes #709 and atom/atom#3854.
This commit is contained in:
Cheng Zhao 2014-10-17 16:04:35 +08:00
parent 4ca6ac34ac
commit ae76657e17

View 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