]> khamidou — GitHub mirrors - electron.git/commitdiff
views: Switching to other window should hide the menubar.
authorCheng Zhao <zcbenz@gmail.com>
Thu, 7 Aug 2014 06:02:03 +0000 (14:02 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 7 Aug 2014 06:02:03 +0000 (14:02 +0800)
atom/browser/native_window_views.cc

index 9a78fa3983b4bb0d8f6176020f721a04674744de..bf58b2094dc3771464b7d49387d13c412537e64f 100644 (file)
@@ -439,6 +439,12 @@ void NativeWindowViews::OnWidgetActivationChanged(
     NotifyWindowFocus();
   else
     NotifyWindowBlur();
+
+  // The menu bar should be hide when window is closed
+  if (!active && menu_bar_autohide_ && menu_bar_show_) {
+    SetMenuBarVisibility(false);
+    Layout();
+  }
 }
 
 void NativeWindowViews::DeleteDelegate() {