From 5b49793d8048b51e3f671eb7c390a08999323876 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 24 Jul 2012 09:40:20 +0200 Subject: Implement synchronous WS events by flushing. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously synchronous window system events were implemented by bypassing the queue and processing the event immediately. This is not ideal since the event order is not preserved - there might be "happened before" events waiting in the queue. Add QWindowSystemInterface::flushWindowSystemEvents and change all handleSynchronous* to 1) queue the event 2) call flushWindowSystemEvents. flushWindowSystemEvents is almost identical to the already existing sendWindowSystemEvents with the exception that it does not call QApp::sendPostedEvents. Move the common implementation to a new private function. Task-number: QTBUG-20778 Change-Id: Ie98a83875bc0a14e335e36bed0dd9e0ed4a1dea0 Reviewed-by: Samuel Rødal Reviewed-by: Friedemann Kleint --- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index a62f792b86..f5e5102844 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -1984,6 +1984,8 @@ 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()); @@ -3987,8 +3989,6 @@ void tst_QWidget::update() #ifdef Q_OS_MAC QEXPECT_FAIL(0, "Cocoa compositor says to paint this twice.", Continue); #endif - if (m_platform == QStringLiteral("windows")) - QEXPECT_FAIL("", "QTBUG-26424", Continue); QTRY_COMPARE(w.numPaintEvents, 1); QCOMPARE(w.visibleRegion(), QRegion(w.rect())); @@ -7594,8 +7594,6 @@ void tst_QWidget::doubleRepaint() widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); QTest::qWait(10); - if (m_platform == QStringLiteral("windows")) - QEXPECT_FAIL("", "QTBUG-26424", Continue); QTRY_COMPARE(widget.numPaintEvents, expectedRepaints); widget.numPaintEvents = 0; -- cgit v1.2.3