Bug 1801459 - Use widget sizemode to decide whether persistent should be saved; r=emilio

Fullscreen state on chrome window might not accurate as it might not be updated
yet, e.g. user clicks the window controls button to switch fullscreen mode on
macOS.

Differential Revision: https://phabricator.services.mozilla.com/D163028
This commit is contained in:
Edgar Chen 2022-11-25 09:02:57 +00:00
parent ca79059cfb
commit 16d373a6ae

View File

@ -2090,12 +2090,7 @@ void AppWindow::SavePersistentAttributes(
return;
}
bool isFullscreen = false;
if (nsPIDOMWindowOuter* domWindow = mDocShell->GetWindow()) {
isFullscreen = domWindow->GetFullScreen();
}
bool shouldPersist = !isFullscreen;
bool shouldPersist = mWindow->SizeMode() != nsSizeMode_Fullscreen;
MaybeSavePersistentPositionAndSize(aAttributes, *docShellElement,
persistString, shouldPersist);
MaybeSavePersistentMiscAttributes(aAttributes, *docShellElement,