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>
bb10
Joerg Bornemann 2012-07-06 14:58:45 +02:00 committed by Qt by Nokia
parent 1a86e35709
commit 1c2d95d1b7
1 changed files with 11 additions and 2 deletions

View File

@ -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)