From b451c9dfdc1421e202b5ce9c2e06931fc0c4c215 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 6 Apr 2018 14:37:22 +0200 Subject: tst_QTouchEvent: Wait for window exposed instead of active MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes the tests pass on Wayland compositors that don't automatically give focus to newly created windows. Such as a headless Weston, which is very useful for testing. Task-number: QTBUG-66846 Change-Id: I502504b333499c89be193a3ebc19d41264a13580 Reviewed-by: Shawn Rutledge Reviewed-by: Jan Arve Sæther --- tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp index d16d95500b..db5e83e2c7 100644 --- a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp +++ b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp @@ -608,7 +608,7 @@ void tst_QTouchEvent::basicRawEventTranslation() touchWidget.setAttribute(Qt::WA_AcceptTouchEvents); touchWidget.setGeometry(100, 100, 400, 300); touchWidget.show(); - QVERIFY(QTest::qWaitForWindowActive(&touchWidget)); + QVERIFY(QTest::qWaitForWindowExposed(&touchWidget)); QPointF pos = touchWidget.rect().center(); QPointF screenPos = touchWidget.mapToGlobal(pos.toPoint()); @@ -741,7 +741,7 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchScreen() rightWidget.setGeometry(300, 100, 100, 100); touchWidget.show(); - QVERIFY(QTest::qWaitForWindowActive(&touchWidget)); + QVERIFY(QTest::qWaitForWindowExposed(&touchWidget)); QPointF leftPos = leftWidget.rect().center(); QPointF rightPos = rightWidget.rect().center(); @@ -968,7 +968,7 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchPad() rightWidget.setGeometry(300, 100, 100, 100); touchWidget.show(); - QVERIFY(QTest::qWaitForWindowActive(&touchWidget)); + QVERIFY(QTest::qWaitForWindowExposed(&touchWidget)); QPointF leftPos = leftWidget.rect().center(); QPointF rightPos = rightWidget.rect().center(); @@ -1184,7 +1184,7 @@ void tst_QTouchEvent::basicRawEventTranslationOfIds() touchWidget.setAttribute(Qt::WA_AcceptTouchEvents); touchWidget.setGeometry(100, 100, 400, 300); touchWidget.show(); - QVERIFY(QTest::qWaitForWindowActive(&touchWidget)); + QVERIFY(QTest::qWaitForWindowExposed(&touchWidget)); QVarLengthArray pos; QVarLengthArray screenPos; -- cgit v1.2.3