Bug 566135 - Fix for full screen games that automatically minimize when firefox is minimized on the taskbar. r=robarnold, a=final.
authorJim Mathies <jmathies@mozilla.com>
Fri, 22 Oct 2010 13:43:40 -0500
changeset 56369 fff8f84d0f94e88b7ba898fdf0127f5c3cfbd13a
parent 56368 824f0cefa25d1460a7c8b4c63de015b8733ab359
child 56370 4ca3a0191455be6ca5953e506b89b0bd1ab9a366
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrobarnold, final
bugs566135
milestone2.0b8pre
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 566135 - Fix for full screen games that automatically minimize when firefox is minimized on the taskbar. r=robarnold, a=final.
widget/src/windows/nsWindow.cpp
--- a/widget/src/windows/nsWindow.cpp
+++ b/widget/src/windows/nsWindow.cpp
@@ -5892,16 +5892,24 @@ void nsWindow::OnWindowPosChanged(WINDOW
     printf("SWP_NOSIZE ");
   if (wp->flags & SWP_HIDEWINDOW)
     printf("SWP_HIDEWINDOW ");
   printf("\n");
 #endif
 
   // Handle window size mode changes
   if (wp->flags & SWP_FRAMECHANGED && mSizeMode != nsSizeMode_Fullscreen) {
+
+    // Bug 566135 - Windows theme code calls show window on SW_SHOWMINIMIZED
+    // windows when fullscreen games disable desktop composition. If we're
+    // minimized and not being activated, ignore the event and let windows
+    // handle it.
+    if (mSizeMode == nsSizeMode_Minimized && (wp->flags & SWP_NOACTIVATE))
+      return;
+
     nsSizeModeEvent event(PR_TRUE, NS_SIZEMODE, this);
 
     WINDOWPLACEMENT pl;
     pl.length = sizeof(pl);
     ::GetWindowPlacement(mWnd, &pl);
 
     if (pl.showCmd == SW_SHOWMAXIMIZED)
       event.mSizeMode = nsSizeMode_Maximized;
@@ -6062,17 +6070,18 @@ void nsWindow::ActivateOtherWindowHelper
 
 #if !defined(WINCE)
 void nsWindow::OnWindowPosChanging(LPWINDOWPOS& info)
 {
   // Update non-client margins if the frame size is changing, and let the
   // browser know we are changing size modes, so alternative css can kick in.
   // If we're going into fullscreen mode, ignore this, since it'll reset
   // margins to normal mode. 
-  if (info->flags & SWP_FRAMECHANGED && mSizeMode != nsSizeMode_Fullscreen) {
+  if ((info->flags & SWP_FRAMECHANGED && !(info->flags & SWP_NOSIZE)) &&
+      mSizeMode != nsSizeMode_Fullscreen) {
     WINDOWPLACEMENT pl;
     pl.length = sizeof(pl);
     ::GetWindowPlacement(mWnd, &pl);
     PRInt32 sizeMode;
     if (pl.showCmd == SW_SHOWMAXIMIZED)
       sizeMode = nsSizeMode_Maximized;
     else if (pl.showCmd == SW_SHOWMINIMIZED)
       sizeMode = nsSizeMode_Minimized;