From 940b40439fe309eb98efa83f7cba28b9b9371888 Mon Sep 17 00:00:00 2001 From: Matthieu Baerts Date: Wed, 15 Oct 2014 14:17:18 +0200 Subject: [PATCH] linux: GlobalMenu: UBUNTU_MENUPROXY with >1 char When testing if $UBUNTU_MENUPROXY is set, we should also check if it contains more than one character. Avoid cases when $UBUNTU_MENUPROXY is set to 0 or 1. --- atom/browser/native_window_views.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 2c0dea85db..664ab50db4 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -68,11 +68,10 @@ 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". + // 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.empty() && name != "0"; + return env && env->GetVar("UBUNTU_MENUPROXY", &name) && name.length() > 1; } #endif