Bug 1813303 - Tweak order of operations in AppWindow::BeforeStartLayout. 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
This commit is contained in:
Emilio Cobos Álvarez 2023-01-31 12:53:56 +00:00
Родитель 057b6edd3e
Коммит 0e964b716b
1 изменённых файлов: 4 добавлений и 1 удалений

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

@ -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();
}