Merge pull request #699 from matttbe/globalmenu

linux: GlobalMenu: only if UBUNTU_MENUPROXY is set
This commit is contained in:
Cheng Zhao 2014-10-13 16:31:04 +08:00
commit 0b48c3ea90

View file

@ -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<base::Environment> 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