Bug 1168274 part 1 - Avoid triggering window reflow for hiding margins when entering fullscreen on Windows. r=jimm
authorXidorn Quan <quanxunzhen@gmail.com>
Tue, 02 Jun 2015 09:22:49 +1200
changeset 246566 14d7c8dce3e4bf76923e5353a55d7c02e881c904
parent 246565 8095c9256ae27c4bde8cd6a0cb93d3993d0bcd24
child 246567 5b928dd10d717854168ab1af99cb62278374d415
push id60477
push userxquan@mozilla.com
push dateMon, 01 Jun 2015 21:23:13 +0000
treeherdermozilla-inbound@14d7c8dce3e4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1168274
milestone41.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 1168274 part 1 - Avoid triggering window reflow for hiding margins when entering fullscreen on Windows. r=jimm
widget/windows/nsWindow.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -2863,17 +2863,19 @@ nsWindow::MakeFullScreen(bool aFullScree
       taskbarInfo->PrepareFullScreenHWND(mWnd, TRUE);
     }
   } else {
     if (mSizeMode != nsSizeMode_Fullscreen)
       return NS_OK;
     SetSizeMode(mOldSizeMode);
   }
 
-  UpdateNonClientMargins();
+  // If we are going fullscreen, the window size continues to change
+  // and the window will be reflow again then.
+  UpdateNonClientMargins(mSizeMode, /* Reflow */ !aFullScreen);
 
   bool visible = mIsVisible;
   if (mOldSizeMode == nsSizeMode_Normal)
     Show(false);
   
   // Will call hide chrome, reposition window. Note this will
   // also cache dimensions for restoration, so it should only
   // be called once per fullscreen request.