diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2018-04-06 14:37:22 +0200 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2018-04-09 07:11:47 +0000 |
commit | b451c9dfdc1421e202b5ce9c2e06931fc0c4c215 (patch) | |
tree | 6725fa13db5eb955cc20e0df47171e5768dbaac0 /tests/auto/gui/kernel | |
parent | 5ffd47b76418eb4ef3369a78471cd6567c4659d0 (diff) |
tst_QTouchEvent: Wait for window exposed instead of active
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 <shawn.rutledge@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'tests/auto/gui/kernel')
-rw-r--r-- | tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp | 8 |
1 files 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<QPointF, 2> pos; QVarLengthArray<QPointF, 2> screenPos; |