Bug 1434986 - Loading a xul document with sizemode=maximized shouldn't resize an already maximized window, r=smaug.
authorFlorian Quèze <florian@queze.net>
Thu, 08 Feb 2018 12:29:02 +0100
changeset 402960 6c50a9ec2d512dfde6fd3d75be66223b7319bbb6
parent 402959 789903045a398360fb92be2892b3bc68b1155cd2
child 402961 31a6b24710a5976f353e715d995527bfa4c86e8a
push id33407
push usercbrindusan@mozilla.com
push dateThu, 08 Feb 2018 19:02:31 +0000
treeherdermozilla-central@c5120bcaf7bd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1434986
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1434986 - Loading a xul document with sizemode=maximized shouldn't resize an already maximized window, r=smaug.
xpfe/appshell/nsXULWindow.cpp
--- a/xpfe/appshell/nsXULWindow.cpp
+++ b/xpfe/appshell/nsXULWindow.cpp
@@ -1362,16 +1362,21 @@ bool nsXULWindow::LoadMiscPersistentAttr
   }
 
   if (sizeMode == nsSizeMode_Fullscreen) {
     nsCOMPtr<mozIDOMWindowProxy> ourWindow;
     GetWindowDOMWindow(getter_AddRefs(ourWindow));
     auto* piWindow = nsPIDOMWindowOuter::From(ourWindow);
     piWindow->SetFullScreen(true);
   } else {
+    // For maximized windows, ignore the XUL size attributes, as setting the
+    // size would set the window back to the normal sizemode.
+    if (sizeMode == nsSizeMode_Maximized) {
+      mIgnoreXULSize = true;
+    }
     mWindow->SetSizeMode(sizeMode);
   }
   gotState = true;
 
   // zlevel
   windowElement->GetAttribute(ZLEVEL_ATTRIBUTE, stateString);
   if (!stateString.IsEmpty()) {
     nsresult errorCode;