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:
parent
9bb634a617
commit
225ada44eb
@ -1359,9 +1359,10 @@ void QWindowsWindow::handleResized(int wParam)
|
|||||||
handleGeometryChange();
|
handleGeometryChange();
|
||||||
break;
|
break;
|
||||||
case SIZE_RESTORED:
|
case SIZE_RESTORED:
|
||||||
bool fullScreen = isFullScreen_sys();
|
if (isFullScreen_sys())
|
||||||
if ((m_windowState != Qt::WindowNoState) || fullScreen)
|
handleWindowStateChange(Qt::WindowFullScreen);
|
||||||
handleWindowStateChange(fullScreen ? Qt::WindowFullScreen : Qt::WindowNoState);
|
else if (m_windowState != Qt::WindowNoState && !testFlag(MaximizeToFullScreen))
|
||||||
|
handleWindowStateChange(Qt::WindowNoState);
|
||||||
handleGeometryChange();
|
handleGeometryChange();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1617,8 +1618,11 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
|
|||||||
if ((oldState == Qt::WindowMaximized) != (newState == Qt::WindowMaximized)) {
|
if ((oldState == Qt::WindowMaximized) != (newState == Qt::WindowMaximized)) {
|
||||||
if (visible && !(newState == Qt::WindowMinimized)) {
|
if (visible && !(newState == Qt::WindowMinimized)) {
|
||||||
setFlag(WithinMaximize);
|
setFlag(WithinMaximize);
|
||||||
|
if (newState == Qt::WindowFullScreen)
|
||||||
|
setFlag(MaximizeToFullScreen);
|
||||||
ShowWindow(m_data.hwnd, (newState == Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNOACTIVATE);
|
ShowWindow(m_data.hwnd, (newState == Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNOACTIVATE);
|
||||||
clearFlag(WithinMaximize);
|
clearFlag(WithinMaximize);
|
||||||
|
clearFlag(MaximizeToFullScreen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,7 +153,8 @@ public:
|
|||||||
AlertState = 0x8000,
|
AlertState = 0x8000,
|
||||||
Exposed = 0x10000,
|
Exposed = 0x10000,
|
||||||
WithinCreate = 0x20000,
|
WithinCreate = 0x20000,
|
||||||
WithinMaximize = 0x40000
|
WithinMaximize = 0x40000,
|
||||||
|
MaximizeToFullScreen = 0x80000
|
||||||
};
|
};
|
||||||
|
|
||||||
QWindowsWindow(QWindow *window, const QWindowsWindowData &data);
|
QWindowsWindow(QWindow *window, const QWindowsWindowData &data);
|
||||||
|
Loading…
Reference in New Issue
Block a user