summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@nokia.com>2012-07-06 14:58:45 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-09 10:50:32 +0200
commit1c2d95d1b7538fa91e2c07c163833da8e415ed91 (patch)
tree39ebee1b71af4caa2aade910bd7d1301a84a6f0d /src/plugins/platforms
parent1a86e35709593fcde8bbbbed6b09092f79aa863c (diff)
QWindowsWindow: fix FullScreen state transition
When putting the window into FullScreen state, we - must not override the saved style and geometry if it has been saved before. E.g. FullScreen -> Minimized -> FullScreen - have to retrieve the window's normal geometry if the window is currently minimized. E.g. Minimized -> FullScreen Task-number: QTBUG-26420 Change-Id: If4164feee5997682406701f0ea7018d7f6257d35 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index d6d12865b4..4be743aaf0 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1237,8 +1237,17 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
// Save geometry and style to be restored when fullscreen
// is turned off again, since on Windows, it is not a real
// Window state but emulated by changing geometry and style.
- m_savedStyle = style();
- m_savedFrameGeometry = frameGeometry_sys();
+ if (!m_savedStyle) {
+ m_savedStyle = style();
+ if (oldStates & Qt::WindowMinimized) {
+ WINDOWPLACEMENT wp;
+ wp.length = sizeof(WINDOWPLACEMENT);
+ if (GetWindowPlacement(m_data.hwnd, &wp))
+ m_savedFrameGeometry = qrectFromRECT(wp.rcNormalPosition);
+ } else {
+ m_savedFrameGeometry = frameGeometry_sys();
+ }
+ }
if (m_savedStyle & WS_SYSMENU)
newStyle |= WS_SYSMENU;
if (visible)