Bug 1764319 [Wayland] Save initial position from nsWindow::Create() r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D143692
This commit is contained in:
stransky 2022-04-14 13:34:28 +00:00
Родитель 59338c231d
Коммит 0971af219a
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -5602,11 +5602,14 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
// We need realized mShell at NativeMoveResize().
gtk_widget_realize(mShell);
// With popup windows, we want to set their position.
// Place them immediately on X11 and save initial popup position
// on Wayland as we place Wayland popup on show.
if (GdkIsX11Display()) {
// With popup windows, we want to control their position, so don't
// wait for the window manager to place them (which wouldn't
// happen with override-redirect windows anyway).
NativeMoveResize(/* move */ true, /* resize */ false);
} else if (AreBoundsSane()) {
GdkRectangle rect = DevicePixelsToGdkRectRoundOut(mBounds);
mPopupPosition = {rect.x, rect.y};
}
} else { // must be eWindowType_toplevel
mGtkWindowRoleName = "Toplevel";