Merge pull request #699 from matttbe/globalmenu
linux: GlobalMenu: only if UBUNTU_MENUPROXY is set
This commit is contained in:
commit
0b48c3ea90
1 changed files with 5 additions and 2 deletions
|
@ -67,9 +67,12 @@ int kWindowsCreated = 0;
|
||||||
bool ShouldUseGlobalMenuBar() {
|
bool ShouldUseGlobalMenuBar() {
|
||||||
// Some DE would pretend to be Unity but don't have global application menu,
|
// Some DE would pretend to be Unity but don't have global application menu,
|
||||||
// so we can not trust unity::IsRunning().
|
// 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());
|
scoped_ptr<base::Environment> env(base::Environment::Create());
|
||||||
return unity::IsRunning() && (base::nix::GetDesktopEnvironment(env.get()) ==
|
std::string name;
|
||||||
base::nix::DESKTOP_ENVIRONMENT_UNITY);
|
return env && env->GetVar("UBUNTU_MENUPROXY", &name) &&
|
||||||
|
!name.empty() && name != "0";
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue