diff options
author | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2017-05-10 10:09:56 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2017-05-10 08:40:02 +0000 |
commit | 802a5be531a9f2b1396f4ea4715c9a1dc593f778 (patch) | |
tree | 7ed3513ef377702680ec9d28b85e9f7989cddc8d /tests/auto/quick/touchmouse | |
parent | 684c8086815ce1fd1db274599fac3d1d63ff0802 (diff) |
Fix hover delivery in case of touch release events
This fixes tst_TouchMouse::hoverEnabled.
It turns out that the problem is that
QQuickWindowPrivate::flushFrameSynchronousEvents would deliver artificial
hover events which (due to the nature of the function) would arrive
without being synchronized with the test. This should not be a problem as
such, but there was one bug: the hover event would also be sent in case
of a touch release event.
The definition of when to "pretend hover" is a bit shaky, but we should
definitely not send hover events after touch releases. By clearing
lastMousePosition instead of setting it to where the touch point is
released we no longer receive bogus events.
Task-number: QTBUG-55350
Change-Id: I4dea54740e37182f66c4a729d7b06a1c770c34a9
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/quick/touchmouse')
-rw-r--r-- | tests/auto/quick/touchmouse/tst_touchmouse.cpp | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/tests/auto/quick/touchmouse/tst_touchmouse.cpp b/tests/auto/quick/touchmouse/tst_touchmouse.cpp index 671cefd6f5..fbdeb1d836 100644 --- a/tests/auto/quick/touchmouse/tst_touchmouse.cpp +++ b/tests/auto/quick/touchmouse/tst_touchmouse.cpp @@ -1448,9 +1448,6 @@ void tst_TouchMouse::hoverEnabled() QVERIFY(!mouseArea2->hovered()); // ------------------------- Touch click on mouseArea2 - if (QGuiApplication::platformName().compare(QLatin1String("xcb"), Qt::CaseInsensitive) == 0) - QSKIP("hover can be momentarily inconsistent on X11, depending on timing of flushFrameSynchronousEvents with touch and mouse movements (QTBUG-55350)"); - QTest::touchEvent(window.data(), device).press(0, p2, window.data()); QVERIFY(mouseArea1->hovered()); |