Fix a crash when minimizing a QQuickWindow.

Send empty expose event and flush queue when minimizing.

Task-number: QTBUG-28439
Task-number: QTBUG-26424

Change-Id: I2e921a86660f946ced7af735cdf197fb666e2934
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
This commit is contained in:
Friedemann Kleint 2013-01-15 16:53:47 +01:00 committed by The Qt Project
parent d6506c129d
commit aacf4d0263
3 changed files with 4 additions and 5 deletions

View File

@ -1260,6 +1260,10 @@ void QWindowsWindow::handleWindowStateChange(Qt::WindowState state)
setFlag(FrameDirty);
m_windowState = state;
QWindowSystemInterface::handleWindowStateChanged(window(), state);
if (state == Qt::WindowMinimized) {
handleHidden();
QWindowSystemInterface::flushWindowSystemEvents(); // Tell QQuickWindow to stop rendering now.
}
}
void QWindowsWindow::setWindowState(Qt::WindowState state)

View File

@ -2043,8 +2043,6 @@ void tst_QWidget::showFullScreen()
QVERIFY(layouted.isFullScreen());
layouted.showFullScreen();
if (m_platform == QStringLiteral("windows"))
QEXPECT_FAIL("", "QTBUG-26424", Continue);
QVERIFY(!layouted.isMinimized());
QVERIFY(layouted.isFullScreen());
QVERIFY(layouted.isVisible());
@ -7115,8 +7113,6 @@ void tst_QWidget::updateWhileMinimized()
// Make sure update requests are discarded until the widget is shown again.
widget.update(0, 0, 50, 50);
QTest::qWait(10);
if (m_platform == QStringLiteral("windows"))
QEXPECT_FAIL("", "QTBUG-26424", Continue);
QCOMPARE(widget.numPaintEvents, 0);
// Restore window.

View File

@ -508,7 +508,6 @@ void tst_QMdiArea::subWindowActivated2()
if (!macHasAccessToWindowsServer())
QEXPECT_FAIL("", "showMinimized doesn't really minimize if you don't have access to the server", Abort);
#endif
QVERIFY(QTest::qWaitForWindowExposed(&mdiArea));
#ifdef Q_OS_WINCE
QSKIP("Not fixed yet. See Task 197453");
#endif