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 259954 312566100da60a845adeb0f0b96826822afc542c
parent 259953 db8aa4fdcba48cc0a9bf0e7a4ea6ebad9c6459f9
child 259955 b8d3872064c7f369787c5097db9956ca99a5253c
push id29296
push userryanvm@gmail.com
push dateSun, 30 Aug 2015 19:45:10 +0000
treeherdermozilla-central@2ad5077d86ba [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);