Bug 668711 - Specified window dimensions in openDialog aren't respected if sizeMode is persisted and set to maximized. r=neil
authorJezreel Ng <jezreel@gmail.com>
Tue, 05 Jul 2011 10:12:05 +0200
changeset 72296 ed0f5032ff400a9865891f77042395313aa3c2a8
parent 72295 f60f5d1e2dde3d8bbc911d61bfbba295d3c4ee50
child 72312 26cce0d3e1030a3ede35b55e257dcf1e36539153
push id20693
push userdgottwald@mozilla.com
push dateTue, 05 Jul 2011 08:13:05 +0000
treeherdermozilla-central@ed0f5032ff40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil
bugs668711
milestone7.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 668711 - Specified window dimensions in openDialog aren't respected if sizeMode is persisted and set to maximized. r=neil
xpfe/appshell/src/nsXULWindow.cpp
--- a/xpfe/appshell/src/nsXULWindow.cpp
+++ b/xpfe/appshell/src/nsXULWindow.cpp
@@ -597,18 +597,21 @@ NS_IMETHODIMP nsXULWindow::SetSize(PRInt
      the window is being opened. but it should probably just always be so. */
   mWindow->SetSizeMode(nsSizeMode_Normal);
 
   mIntrinsicallySized = PR_FALSE;
 
   NS_ENSURE_SUCCESS(mWindow->Resize(aCX, aCY, aRepaint), NS_ERROR_FAILURE);
   if (!mChromeLoaded) {
     // If we're called before the chrome is loaded someone obviously wants this
-    // window at this size. We don't persist this one-time size.
+    // window at this size & in the normal size mode (since it is the only mode
+    // in which setting dimensions makes sense). We don't persist this one-time
+    // size.
     mIgnoreXULSize = PR_TRUE;
+    mIgnoreXULSizeMode = PR_TRUE;
     return NS_OK;
   }
   PersistentAttributesDirty(PAD_SIZE);
   SavePersistentAttributes();
   return NS_OK;
 }
 
 NS_IMETHODIMP nsXULWindow::GetSize(PRInt32* aCX, PRInt32* aCY)
@@ -627,16 +630,17 @@ NS_IMETHODIMP nsXULWindow::SetPositionAn
   mIntrinsicallySized = PR_FALSE;
 
   NS_ENSURE_SUCCESS(mWindow->Resize(aX, aY, aCX, aCY, aRepaint), NS_ERROR_FAILURE);
   if (!mChromeLoaded) {
     // If we're called before the chrome is loaded someone obviously wants this
     // window at this size and position. We don't persist this one-time setting.
     mIgnoreXULPosition = PR_TRUE;
     mIgnoreXULSize = PR_TRUE;
+    mIgnoreXULSizeMode = PR_TRUE;
     return NS_OK;
   }
   PersistentAttributesDirty(PAD_POSITION | PAD_SIZE);
   SavePersistentAttributes();
   return NS_OK;
 }
 
 NS_IMETHODIMP nsXULWindow::GetPositionAndSize(PRInt32* x, PRInt32* y, PRInt32* cx,