diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-10-01 11:40:49 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-12-01 12:48:37 +0000 |
commit | 5f00d18ad34979f57d6c17770ee9df5a2acb93e6 (patch) | |
tree | fcfc016a4e14b7fb62e3aea50cede2d7d220e41f | |
parent | 5d63e325faa44cf1345d6f7b5cb39ec874527675 (diff) |
Windows QPA: Fix window state transition from minimized to normal.
Use SW_SHOWNORMAL instead SW_SHOWNOACTIVATE as a parameter to
ShowWindow() to enforce the window to be restored to normal state,
even if the state before minimized was maximized.
Task-number: QTBUG-48449
Change-Id: I9436623b1495f574a72050e50e8b31bfc83ced5c
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 2 | ||||
-rw-r--r-- | tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 4 |
2 files changed, 1 insertions, 5 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index c49682cc26..48484209b5 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1779,7 +1779,7 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState) if ((oldState == Qt::WindowMinimized) != (newState == Qt::WindowMinimized)) { if (visible) ShowWindow(m_data.hwnd, (newState == Qt::WindowMinimized) ? SW_MINIMIZE : - (newState == Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNOACTIVATE); + (newState == Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNORMAL); } qCDebug(lcQpaWindows) << '<' << __FUNCTION__ << this << window() << newState; } diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index f3f4467b80..97c23ddf26 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -1860,10 +1860,6 @@ void tst_QWidget::activation() QCOMPARE(QApplication::activeWindow(), &widget1); widget2.showNormal(); QTest::qWait(waitTime); -#ifndef Q_OS_WINCE - if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA) - QEXPECT_FAIL("", "MS introduced new behavior after XP", Continue); -#endif QTest::qWait(waitTime); QCOMPARE(QApplication::activeWindow(), &widget2); widget2.hide(); |