Only call ShowWindow() once when going from FullScreen to Maximized

Since going from FullScreen to Maximized is taken care of inside the
FullScreen block then we don't want to call ShowWindow() again in the
Maximized block. Therefore the Maximized block is moved so it is only
invoked if it is not coming or going to fullscreen.

As the minimized case is not accounted for in FullScreen that is left as
is in its own if block.

Task-number: QTBUG-43849
Change-Id: I3141347e072c50b2a4475098d7b8ee0b207578a7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
Andy Shaw 2015-01-14 20:35:21 +01:00
parent b69c2e86de
commit 17cce24648

View File

@ -1620,17 +1620,6 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
setFlag(FrameDirty);
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);
}
}
if ((oldState == Qt::WindowFullScreen) != (newState == Qt::WindowFullScreen)) {
#ifdef Q_OS_WINCE
HWND handle = FindWindow(L"HHTaskBar", L"");
@ -1710,6 +1699,15 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
m_savedStyle = 0;
m_savedFrameGeometry = QRect();
}
} else 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);
}
}
if ((oldState == Qt::WindowMinimized) != (newState == Qt::WindowMinimized)) {