Bug 1192655 - Make menubar not react to events when it is not visible. r=enn
authorXidorn Quan <quanxunzhen@gmail.com>
Sat, 29 Aug 2015 11:12:41 +1000
changeset 259909 312566100da60a845adeb0f0b96826822afc542c
parent 259908 db8aa4fdcba48cc0a9bf0e7a4ea6ebad9c6459f9
child 259910 b8d3872064c7f369787c5097db9956ca99a5253c
push id64367
push userxquan@mozilla.com
push dateSat, 29 Aug 2015 01:13:08 +0000
treeherdermozilla-inbound@05c0212b9f16 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersenn
bugs1192655
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1192655 - Make menubar not react to events when it is not visible. r=enn
layout/xul/nsMenuBarListener.cpp
--- a/layout/xul/nsMenuBarListener.cpp
+++ b/layout/xul/nsMenuBarListener.cpp
@@ -403,16 +403,21 @@ nsMenuBarListener::MouseDown(nsIDOMEvent
 
   return NS_OK; // means I am NOT consuming event
 }
 
 ////////////////////////////////////////////////////////////////////////
 nsresult
 nsMenuBarListener::HandleEvent(nsIDOMEvent* aEvent)
 {
+  // If the menu bar is collapsed, don't do anything.
+  if (!mMenuBarFrame->StyleVisibility()->IsVisible()) {
+    return NS_OK;
+  }
+
   nsAutoString eventType;
   aEvent->GetType(eventType);
   
   if (eventType.EqualsLiteral("keyup")) {
     return KeyUp(aEvent);
   }
   if (eventType.EqualsLiteral("keydown")) {
     return KeyDown(aEvent);