summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2015-01-14 20:35:21 +0100
committerAndy Shaw <andy.shaw@digia.com>2015-01-19 10:44:42 +0100
commit17cce246487ca8a9b2d1999bfdbbb3b368b44177 (patch)
treebe5db7e674aee08f5635770fd48e8cefd31c0861
parentb69c2e86de99cb2ac9bcd2e33ae77c960cfbc57a (diff)
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>
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 6279b6f4af..e7061dbfde 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -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)) {