File 2.diff of Package Firefox
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -1993,22 +1993,28 @@ void nsWindow::NativeMoveResizeWaylandPo
// from layout.
NativeMoveResize(movedByLayout, resizedByLayout);
return;
}
LOG(" orig mBounds [%d, %d] -> [%d x %d]\n", mBounds.x, mBounds.y,
mBounds.width, mBounds.height);
- LayoutDeviceIntRect newBounds = [&] {
+ const LayoutDeviceIntRect newBounds = [&] {
GdkRectangle finalRect = *aFinalSize;
GdkPoint parent = WaylandGetParentPosition();
finalRect.x += parent.x;
finalRect.y += parent.y;
- return GdkRectToDevicePixels(finalRect);
+ auto roundTo = RoundsWidgetCoordinatesTo();
+ auto rect = GdkRectToDevicePixels(finalRect);
+ // Ensure we do the same rounding that nsView would do, see
+ // MaybeRoundToDisplayPixels.
+ auto size = !mIsTransparent ? rect.Size().TruncatedToMultiple(roundTo)
+ : rect.Size().CeiledToMultiple(roundTo);
+ return LayoutDeviceIntRect(rect.TopLeft().RoundedToMultiple(roundTo), size);
}();
LOG(" new mBounds [%d, %d] -> [%d x %d]", newBounds.x, newBounds.y,
newBounds.width, newBounds.height);
bool needsPositionUpdate = newBounds.TopLeft() != mBounds.TopLeft();
bool needsSizeUpdate = newBounds.Size() != mLastSizeRequest;