Bug 1640567 Pass expected window position to the NativeMoveResizeWaylandPopup to avoid repositioning; r=stransky
authorJan Horak <jhorak@redhat.com>
Thu, 01 Oct 2020 10:18:37 +0000
changeset 551038 f7052818df291d3a7f8b59f24d4a5bd369d85855
parent 551037 38ee4af29718884820d7a0d32ff9b601f68b4173
child 551039 59f393119687684d328da79be8b52765959c003a
push id37825
push userabutkovits@mozilla.com
push dateFri, 02 Oct 2020 04:10:47 +0000
treeherdermozilla-central@d70d61772f1a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersstransky
bugs1640567
milestone83.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 1640567 Pass expected window position to the NativeMoveResizeWaylandPopup to avoid repositioning; r=stransky If the position expected position of popup is not changed by the GTK (it popup fit into the screen) we don't have to update position of nsMenuPopupFrame in Gecko view. We sent the anchor position instead of expected popup position to the NativeMoveResizeWaylandPopup which triggered the view changes. Differential Revision: https://phabricator.services.mozilla.com/D92043
layout/xul/nsMenuPopupFrame.cpp
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -1417,21 +1417,19 @@ nsresult nsMenuPopupFrame::SetPopupPosit
       // it around later. The AdjustPositionForAnchorAlign method accounts for
       // the popup's margin.
 
 #ifdef MOZ_WAYLAND
       if (gdk_display_get_default() &&
           !GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
         screenPoint = nsPoint(anchorRect.x, anchorRect.y);
         mAnchorRect = anchorRect;
-      } else
+      }
 #endif
-      {
-        screenPoint = AdjustPositionForAnchorAlign(anchorRect, hFlip, vFlip);
-      }
+      screenPoint = AdjustPositionForAnchorAlign(anchorRect, hFlip, vFlip);
     } else {
       // with no anchor, the popup is positioned relative to the root frame
       anchorRect = rootScreenRect;
       screenPoint = anchorRect.TopLeft() + nsPoint(margin.left, margin.top);
     }
 
     // mXPos and mYPos specify an additonal offset passed to OpenPopup that
     // should be added to the position.  We also add the offset to the anchor