Bug 1789823 - Remove redundant SetSizeMode call from AppWindow::SizeModeChanged. r=stransky

This is the listener for a size mode change, shouldn't need to set the
size mode again. While at it, match coding style better.

This doesn't change behavior now, but with the next patch it would.

Differential Revision: https://phabricator.services.mozilla.com/D157597
This commit is contained in:
Emilio Cobos Álvarez 2022-09-19 09:39:10 +00:00
Родитель 853e5e4873
Коммит db7ddc382a
1 изменённых файлов: 8 добавлений и 7 удалений

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

@ -2810,17 +2810,18 @@ bool AppWindow::RequestWindowClose(nsIWidget* aWidget) {
return false;
}
void AppWindow::SizeModeChanged(nsSizeMode sizeMode) {
void AppWindow::SizeModeChanged(nsSizeMode aSizeMode) {
// An alwaysRaised (or higher) window will hide any newly opened normal
// browser windows, so here we just drop a raised window to the normal
// zlevel if it's maximized. We make no provision for automatically
// re-raising it when restored.
if (sizeMode == nsSizeMode_Maximized || sizeMode == nsSizeMode_Fullscreen) {
if (aSizeMode == nsSizeMode_Maximized || aSizeMode == nsSizeMode_Fullscreen) {
uint32_t zLevel;
GetZLevel(&zLevel);
if (zLevel > nsIAppWindow::normalZ) SetZLevel(nsIAppWindow::normalZ);
if (zLevel > nsIAppWindow::normalZ) {
SetZLevel(nsIAppWindow::normalZ);
}
}
mWindow->SetSizeMode(sizeMode);
RecomputeBrowsingContextVisibility();
@ -2833,9 +2834,9 @@ void AppWindow::SizeModeChanged(nsSizeMode sizeMode) {
if (ourWindow) {
// Ensure that the fullscreen state is synchronized between
// the widget and the outer window object.
if (sizeMode == nsSizeMode_Fullscreen) {
if (aSizeMode == nsSizeMode_Fullscreen) {
ourWindow->SetFullScreen(true);
} else if (sizeMode != nsSizeMode_Minimized) {
} else if (aSizeMode != nsSizeMode_Minimized) {
if (ourWindow->GetFullScreen()) {
// The first SetFullscreenInternal call below ensures that we do
// not trigger any fullscreen transition even if the window was
@ -2854,7 +2855,7 @@ void AppWindow::SizeModeChanged(nsSizeMode sizeMode) {
}
if (PresShell* presShell = GetPresShell()) {
presShell->GetPresContext()->SizeModeChanged(sizeMode);
presShell->GetPresContext()->SizeModeChanged(aSizeMode);
}
// Note the current implementation of SetSizeMode just stores