QWindowsWindow: fix restoring from minimized to fullscreen
authorJoerg Bornemann <joerg.bornemann@nokia.com>
Fri, 6 Jul 2012 12:49:34 +0000 (14:49 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 9 Jul 2012 08:50:27 +0000 (10:50 +0200)
This fixes the state transition FullScreen -> Minimized -> FullScreen.

Task-number: QTBUG-26420
Change-Id: I555c4f332e796b465149e592c2583d615b37c4ec
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
src/plugins/platforms/windows/qwindowswindow.cpp
src/plugins/platforms/windows/qwindowswindow.h

index a2a7950..0593778 100644 (file)
@@ -980,7 +980,7 @@ void QWindowsWindow::handleResized(int wParam)
         break;
     case SIZE_RESTORED:
         if (m_windowState != Qt::WindowNoState)
-            handleWindowStateChange(Qt::WindowNoState);
+            handleWindowStateChange(isFullScreen_sys() ? Qt::WindowFullScreen : Qt::WindowNoState);
         handleGeometryChange();
         break;
     }
@@ -1170,7 +1170,7 @@ Qt::WindowState QWindowsWindow::windowState_sys() const
         return Qt::WindowMinimized;
     if (IsZoomed(m_data.hwnd))
         return Qt::WindowMaximized;
-    if (geometry_sys() == window()->screen()->geometry())
+    if (isFullScreen_sys())
         return Qt::WindowFullScreen;
     return Qt::WindowNoState;
 }
@@ -1183,6 +1183,11 @@ Qt::WindowStates QWindowsWindow::windowStates_sys() const
     return result;
 }
 
+bool QWindowsWindow::isFullScreen_sys() const
+{
+    return geometry_sys() == window()->screen()->geometry();
+}
+
 /*!
     \brief Change the window state.
 
index 475982a..ff99d5c 100644 (file)
@@ -246,6 +246,7 @@ private:
     inline QRect frameGeometry_sys() const;
     inline QRect geometry_sys() const;
     inline WindowData setWindowFlags_sys(Qt::WindowFlags wt, unsigned flags = 0) const;
+    inline bool isFullScreen_sys() const;
     inline void setWindowState_sys(Qt::WindowState newState);
     inline void setParent_sys(const QPlatformWindow *parent) const;
     inline void setMouseGrabEnabled_sys(bool grab);