Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 379437c

Browse files
committed
Bug 1945834 - Fix handling of direct position on wayland popups after bug 581863. r=stransky
The code was relying on mBounds being set sync, which was only true for popups before that change, and is no longer the case now. Differential Revision: https://phabricator.services.mozilla.com/D236734
1 parent 8ea55e4 commit 379437c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

widget/gtk/nsWindow.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2115,7 +2115,7 @@ bool nsWindow::IsPopupDirectionRTL() {
21152115
// It's used when we position noautihode popup and we don't use xdg_positioner.
21162116
// See Bug 1718867
21172117
void nsWindow::WaylandPopupSetDirectPosition() {
2118-
GdkPoint topLeft = DevicePixelsToGdkPointRoundDown(mBounds.TopLeft());
2118+
GdkPoint topLeft = DevicePixelsToGdkPointRoundDown(mLastMoveRequest);
21192119
GdkRectangle size = DevicePixelsToGdkSizeRoundUp(mLastSizeRequest);
21202120

21212121
LOG("nsWindow::WaylandPopupSetDirectPosition %d,%d -> %d x %d\n", topLeft.x,
@@ -2197,7 +2197,7 @@ bool nsWindow::WaylandPopupFitsToplevelWindow(bool aMove) {
21972197
LOG(" parent size %d x %d", parentWidth, parentHeight);
21982198

21992199
GdkPoint topLeft = aMove ? mPopupPosition
2200-
: DevicePixelsToGdkPointRoundDown(mBounds.TopLeft());
2200+
: DevicePixelsToGdkPointRoundDown(mLastMoveRequest);
22012201
GdkRectangle size = DevicePixelsToGdkSizeRoundUp(mLastSizeRequest);
22022202
LOG(" popup topleft %d, %d size %d x %d", topLeft.x, topLeft.y, size.width,
22032203
size.height);
@@ -2210,7 +2210,7 @@ bool nsWindow::WaylandPopupFitsToplevelWindow(bool aMove) {
22102210
}
22112211

22122212
void nsWindow::NativeMoveResizeWaylandPopup(bool aMove, bool aResize) {
2213-
GdkPoint topLeft = DevicePixelsToGdkPointRoundDown(mBounds.TopLeft());
2213+
GdkPoint topLeft = DevicePixelsToGdkPointRoundDown(mLastMoveRequest);
22142214
GdkRectangle size = DevicePixelsToGdkSizeRoundUp(mLastSizeRequest);
22152215

22162216
LOG("nsWindow::NativeMoveResizeWaylandPopup Bounds %d,%d -> %d x %d move %d "

0 commit comments

Comments
 (0)