@@ -1162,7 +1162,7 @@ void nsWindow::Move(double aX, double aY) {
1162
1162
if (!mCreated ) return ;
1163
1163
1164
1164
if (IsWaylandPopup ()) {
1165
- int32_t p2a = AppUnitsPerCSSPixel ();
1165
+ int32_t p2a = AppUnitsPerCSSPixel () / gfxPlatformGtk::GetFontScaleFactor ();
1166
1166
if (mPreferredPopupRect .x != mBounds .x * p2a &&
1167
1167
mPreferredPopupRect .y != mBounds .y * p2a) {
1168
1168
NativeMove ();
@@ -1451,7 +1451,7 @@ void nsWindow::NativeMoveResizeWaylandPopupCB(const GdkRectangle* aFinalSize,
1451
1451
// Update view
1452
1452
1453
1453
if (needsSizeUpdate) {
1454
- int32_t p2a = AppUnitsPerCSSPixel ();
1454
+ int32_t p2a = AppUnitsPerCSSPixel () / gfxPlatformGtk::GetFontScaleFactor () ;
1455
1455
mPreferredPopupRect = nsRect (NSIntPixelsToAppUnits(newBounds.x , p2a),
1456
1456
NSIntPixelsToAppUnits (newBounds.y, p2a),
1457
1457
NSIntPixelsToAppUnits(newBounds.width, p2a),
@@ -1550,10 +1550,11 @@ void nsWindow::NativeMoveResizeWaylandPopup(GdkPoint* aPosition,
1550
1550
// Get anchor rectangle
1551
1551
LayoutDeviceIntRect anchorRect (0 , 0 , 0 , 0 );
1552
1552
nsMenuPopupFrame* popupFrame = GetMenuPopupFrame (GetFrame ());
1553
+ int32_t p2a = AppUnitsPerCSSPixel () / gfxPlatformGtk::GetFontScaleFactor ();
1553
1554
if (popupFrame) {
1554
1555
#ifdef MOZ_WAYLAND
1555
1556
anchorRect = LayoutDeviceIntRect::FromAppUnitsToNearest (
1556
- popupFrame->GetAnchorRect (), AppUnitsPerCSSPixel () );
1557
+ popupFrame->GetAnchorRect (), p2a );
1557
1558
#endif
1558
1559
}
1559
1560
@@ -1689,7 +1690,6 @@ void nsWindow::NativeMoveResizeWaylandPopup(GdkPoint* aPosition,
1689
1690
G_CALLBACK (NativeMoveResizeWaylandPopupCallback), this );
1690
1691
}
1691
1692
1692
- int32_t p2a = AppUnitsPerCSSPixel ();
1693
1693
LOG ((" popup window cursor offset x: %d y: %d\n " , cursorOffset.x / p2a,
1694
1694
cursorOffset.y / p2a));
1695
1695
mWaitingForMoveToRectCB = true ;
0 commit comments