Bug 634586 - Briefly hide the window when transitioning to full screen on Windows. Improves full screen transitions and fixes bug 624258. r=roc
authorJim Mathies <jmathies@mozilla.com>
Mon, 28 Mar 2011 16:54:05 -0500
changeset 64073 5b20af343bd4ef9d944352af9d258d5915b9dd14
parent 64072 55dbe8aad0bf01d06c07f3d06a24e6cd22a2d965
child 64074 0864cd7f9e9b704a673a4bad42b5aac40cf578f3
push idunknown
push userunknown
push dateunknown
reviewersroc
bugs634586, 624258
milestone2.2a1pre
Bug 634586 - Briefly hide the window when transitioning to full screen on Windows. Improves full screen transitions and fixes bug 624258. r=roc
widget/src/windows/nsWindow.cpp
--- a/widget/src/windows/nsWindow.cpp
+++ b/widget/src/windows/nsWindow.cpp
@@ -2893,31 +2893,26 @@ nsWindow::MakeFullScreen(PRBool aFullScr
     mOldSizeMode = mSizeMode;
     SetSizeMode(nsSizeMode_Fullscreen);
   } else {
     SetSizeMode(mOldSizeMode);
   }
 
   UpdateNonClientMargins();
 
-  // Prevent window updates during the transition.
-  DWORD style;
-  if (nsUXThemeData::CheckForCompositor()) {
-    style = GetWindowLong(mWnd, GWL_STYLE);
-    SetWindowLong(mWnd, GWL_STYLE, style & ~WS_VISIBLE);
-  }
-
+  PRBool visible = mIsVisible;
+  Show(PR_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.
   nsresult rv = nsBaseWidget::MakeFullScreen(aFullScreen);
 
-  if (nsUXThemeData::CheckForCompositor()) {
-    style = GetWindowLong(mWnd, GWL_STYLE);
-    SetWindowLong(mWnd, GWL_STYLE, style | WS_VISIBLE);
+  if (visible) {
+    Show(PR_TRUE);
     Invalidate(PR_FALSE);
   }
 
   // Let the dom know via web shell window
   nsSizeModeEvent event(PR_TRUE, NS_SIZEMODE, this);
   event.mSizeMode = mSizeMode;
   InitEvent(event);
   DispatchWindowEvent(&event);