From 5f00d18ad34979f57d6c17770ee9df5a2acb93e6 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 1 Oct 2015 11:40:49 +0200 Subject: 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 --- src/plugins/platforms/windows/qwindowswindow.cpp | 2 +- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 4 ---- 2 files changed, 1 insertion(+), 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(); -- cgit v1.2.3