Windows: Suppress window state change to normal when going from maximized to fullscreen.

Task-number: QTBUG-35166

Change-Id: Idcf2d2a5fd0dc59f35a287c106ca772d801550c0
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
Friedemann Kleint 2014-03-26 16:34:02 +01:00 committed by The Qt Project
parent 9bb634a617
commit 225ada44eb
2 changed files with 9 additions and 4 deletions

View File

@ -1359,9 +1359,10 @@ void QWindowsWindow::handleResized(int wParam)
handleGeometryChange();
break;
case SIZE_RESTORED:
bool fullScreen = isFullScreen_sys();
if ((m_windowState != Qt::WindowNoState) || fullScreen)
handleWindowStateChange(fullScreen ? Qt::WindowFullScreen : Qt::WindowNoState);
if (isFullScreen_sys())
handleWindowStateChange(Qt::WindowFullScreen);
else if (m_windowState != Qt::WindowNoState && !testFlag(MaximizeToFullScreen))
handleWindowStateChange(Qt::WindowNoState);
handleGeometryChange();
break;
}
@ -1617,8 +1618,11 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
if ((oldState == Qt::WindowMaximized) != (newState == Qt::WindowMaximized)) {
if (visible && !(newState == Qt::WindowMinimized)) {
setFlag(WithinMaximize);
if (newState == Qt::WindowFullScreen)
setFlag(MaximizeToFullScreen);
ShowWindow(m_data.hwnd, (newState == Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNOACTIVATE);
clearFlag(WithinMaximize);
clearFlag(MaximizeToFullScreen);
}
}

View File

@ -153,7 +153,8 @@ public:
AlertState = 0x8000,
Exposed = 0x10000,
WithinCreate = 0x20000,
WithinMaximize = 0x40000
WithinMaximize = 0x40000,
MaximizeToFullScreen = 0x80000
};
QWindowsWindow(QWindow *window, const QWindowsWindowData &data);