Skip to content

Commit 665f15a

Browse files
committed
Bug 1998596 - Don't notify of moves on invisible windows. r=mac-reviewers,mstange
If we're not visible yet, our NSWindow might not have the correct frame yet, causing us to perform a move to 0, 0, effectively losing the anchoring. It's a bit unclear whether we want to react to WindowMoved for popups anyways, we generally assume we're in control of window positioning (except for some wayland shenanigans). Differential Revision: https://phabricator.services.mozilla.com/D273726
1 parent 8b35855 commit 665f15a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

widget/cocoa/nsCocoaWindow.mm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6549,8 +6549,10 @@ static nsSizeMode GetWindowSizeMode(NSWindow* aWindow, bool aFullScreen) {
65496549
DispatchSizeModeEvent();
65506550
}
65516551

6552-
// Dispatch the move event to Gecko
6553-
NotifyWindowMoved(mBounds.x, mBounds.y);
6552+
// Dispatch the move event to Gecko, if we're visible.
6553+
if (IsVisible()) {
6554+
NotifyWindowMoved(mBounds.x, mBounds.y);
6555+
}
65546556

65556557
mInReportMoveEvent = false;
65566558

0 commit comments

Comments
 (0)