From 4a7e98e398422a5783d26d7a8944ec6e405bce53 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 31 Jul 2014 13:09:31 +0800 Subject: [PATCH] linux: Only use global application menubar on unity. Fixes atom/atom#3114. --- atom/browser/native_window_views.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 4c99a56389fc..dd672b281b42 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -39,6 +39,7 @@ #if defined(USE_X11) #include "atom/browser/ui/views/global_menu_bar_x11.h" #include "atom/browser/ui/views/frameless_view.h" +#include "chrome/browser/ui/libgtk2ui/unity_service.h" #include "ui/gfx/x/x11_types.h" #include "ui/views/window/native_frame_view.h" #elif defined(OS_WIN) @@ -338,11 +339,11 @@ void NativeWindowViews::SetMenu(ui::MenuModel* menu_model) { RegisterAccelerators(menu_model); #if defined(USE_X11) - if (!global_menu_bar_) + if (unity::IsRunning() && !global_menu_bar_) global_menu_bar_.reset(new GlobalMenuBarX11(this)); // Use global application menu bar when possible. - if (global_menu_bar_->IsServerStarted()) { + if (global_menu_bar_ && global_menu_bar_->IsServerStarted()) { global_menu_bar_->SetMenu(menu_model); return; }