Bug 1682136 - Allow slop when the window position is persistent and it has no parent. r=xpcom-reviewers,nika

Differential Revision: https://phabricator.services.mozilla.com/D109708
This commit is contained in:
Masatoshi Kimura 2021-03-29 21:41:07 +00:00
parent 366b431f08
commit c6dccb4a09

View File

@ -1286,6 +1286,7 @@ bool AppWindow::LoadPositionFromXUL(int32_t aSpecWidth, int32_t aSpecHeight) {
gotPosition = true;
}
bool allowSlop = false;
if (gotPosition) {
// our position will be relative to our parent, if any
nsCOMPtr<nsIBaseWindow> parent(do_QueryReferent(mParentWindow));
@ -1302,9 +1303,10 @@ bool AppWindow::LoadPositionFromXUL(int32_t aSpecWidth, int32_t aSpecHeight) {
}
} else {
StaggerPosition(specX, specY, cssWidth, cssHeight);
allowSlop = true;
}
}
mWindow->ConstrainPosition(false, &specX, &specY);
mWindow->ConstrainPosition(allowSlop, &specX, &specY);
if (specX != currX || specY != currY) {
SetPositionDesktopPix(specX, specY);
}