Bug 1795804 - Persist sizemode synchronously. r=smaug

Much like everything else. This is important because the front-end uses
sizemode for styling.

The comment I'm removing doesn't really make much sense, since sizemode
and size are persisted separately (using different dirty flags) so it's
not like we're saving duplicate work or something.

The delay this fixes existed already on Linux since ~forever at least,
haven't tested macOS.

Depends on D159578

Differential Revision: https://phabricator.services.mozilla.com/D159579
This commit is contained in:
Emilio Cobos Álvarez 2022-10-20 08:30:16 +00:00
parent be12f96292
commit e2a5d100fe

View file

@ -2825,10 +2825,7 @@ void AppWindow::SizeModeChanged(nsSizeMode aSizeMode) {
RecomputeBrowsingContextVisibility(); RecomputeBrowsingContextVisibility();
// Persist mode, but not immediately, because in many (all?) PersistentAttributesDirty(PersistentAttribute::Misc, Sync);
// cases this will merge with the similar call in NS_SIZE and
// write the attribute values only once.
PersistentAttributesDirty(PersistentAttribute::Misc, Async);
nsCOMPtr<nsPIDOMWindowOuter> ourWindow = nsCOMPtr<nsPIDOMWindowOuter> ourWindow =
mDocShell ? mDocShell->GetWindow() : nullptr; mDocShell ? mDocShell->GetWindow() : nullptr;
if (ourWindow) { if (ourWindow) {