From c4b0170a0ac0405309b0578e81252a75977b72b3 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 8 Aug 2014 14:30:43 +0800 Subject: [PATCH] views: Only toggle menu bar when auto-hide-menu-bar is turned on. --- atom/browser/native_window_views.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 26697f0dcba..d3c12dd8821 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -568,6 +568,11 @@ void NativeWindowViews::HandleMouseDown() { void NativeWindowViews::HandleKeyboardEvent( content::WebContents*, const content::NativeWebKeyboardEvent& event) { + keyboard_event_handler_->HandleKeyboardEvent(event, GetFocusManager()); + + if (!menu_bar_autohide_) + return; + // Toggle the menu bar only when a single Alt is released. if (event.type == blink::WebInputEvent::RawKeyDown && IsAltKey(event) && IsAltModifier(event)) { @@ -583,8 +588,6 @@ void NativeWindowViews::HandleKeyboardEvent( // When any other keys except single Alt have been pressed/released: menu_bar_alt_pressed_ = false; } - - keyboard_event_handler_->HandleKeyboardEvent(event, GetFocusManager()); } bool NativeWindowViews::AcceleratorPressed(const ui::Accelerator& accelerator) {