Bug 1648686 - Don't rollup the hamburger menu when pinching over content (on mac). r=tnikkel
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 13 Aug 2020 09:45:26 +0000
changeset 544527 9ef828c9bd891822d22c53a6af567023f0128568
parent 544526 4e0b6d7a8e48a9cf2c83ec41d5e433047b4f2da5
child 544528 06e4f8547d78187f934074b2b4ff4d4d4d12efd5
push id124090
push userkgupta@mozilla.com
push dateThu, 13 Aug 2020 12:37:23 +0000
treeherderautoland@9ef828c9bd89 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel
bugs1648686
milestone81.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 1648686 - Don't rollup the hamburger menu when pinching over content (on mac). r=tnikkel It seems like ShouldRollupOnMouseWheelEvent really means something more like "ShouldRollupIfPageIsGonnaMove" so it seems appropriate to use in this situation. Might be worth renaming the function at some point if my interpration is correct, but the name propagates into xhtml attributes and such so it's more than I want to do right now. Differential Revision: https://phabricator.services.mozilla.com/D86839
widget/cocoa/nsChildView.mm
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -2671,18 +2671,18 @@ NSEvent* gLastDragMouseDownEvent = nil; 
   NS_ENSURE_TRUE(rollupListener, false);
   nsCOMPtr<nsIWidget> rollupWidget = rollupListener->GetRollupWidget();
   if (rollupWidget) {
     NSWindow* currentPopup = static_cast<NSWindow*>(rollupWidget->GetNativeData(NS_NATIVE_WINDOW));
     if (!nsCocoaUtils::IsEventOverWindow(theEvent, currentPopup)) {
       // event is not over the rollup window, default is to roll up
       bool shouldRollup = true;
 
-      // check to see if scroll events should roll up the popup
-      if ([theEvent type] == NSScrollWheel) {
+      // check to see if scroll/zoom events should roll up the popup
+      if ([theEvent type] == NSScrollWheel || [theEvent type] == NSEventTypeMagnify) {
         shouldRollup = rollupListener->ShouldRollupOnMouseWheelEvent();
         // consume scroll events that aren't over the popup
         // unless the popup is an arrow panel
         consumeEvent = rollupListener->ShouldConsumeOnMouseWheelEvent();
       }
 
       // if we're dealing with menus, we probably have submenus and
       // we don't want to rollup if the click is in a parent menu of