Skip to content

Commit

Permalink
Bug 1813303 - Tweak order of operations in AppWindow::BeforeStartLayo…
Browse files Browse the repository at this point in the history
…ut. r=smaug

Sync the chromemargin attribute to the widget before restoring the
sizes, since the later depend on the former.

This is the same order we use when sizing the shell in OnChromeLoaded,
so it should be more consistent.

Differential Revision: https://phabricator.services.mozilla.com/D168200
  • Loading branch information
emilio committed Jan 31, 2023
1 parent 057b6ed commit 0e964b7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion xpfe/appshell/AppWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2556,8 +2556,11 @@ void AppWindow::ApplyChromeFlags() {
NS_IMETHODIMP
AppWindow::BeforeStartLayout() {
ApplyChromeFlags();
LoadPersistentWindowState();
// Ordering here is important, loading width/height values in
// LoadPersistentWindowState() depends on the chromemargin attribute (since
// we need to translate outer to inner sizes).
SyncAttributesToWidget();
LoadPersistentWindowState();
if (mWindow) {
SizeShell();
}
Expand Down

0 comments on commit 0e964b7

Please sign in to comment.