From 80dbc30e97c4c6def74a026ce0b50390990cc612 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 26 Jul 2016 23:52:31 +0200 Subject: Touch and mouse handling: don't pre-grab The touchmouse test needs adjusting since we don't see ungrab events any more (which makes sense, nobody actively grabbed anything there). The comment about storing the touchMouseId early enough is invalid - any item that wants to steal the grab, has to call grab anyway. The reason to only update the grab when there is no grabber set yet, is that in the filterChildMouse stuff some other item might steal the event, setting the grabber there - that must not be overridden when we come back to the original event handling. Change-Id: I4f191b16f4d76113d0c88414b5a80eb1baf99be1 Reviewed-by: Frederik Gladhorn --- tests/auto/quick/touchmouse/tst_touchmouse.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/quick/touchmouse/tst_touchmouse.cpp b/tests/auto/quick/touchmouse/tst_touchmouse.cpp index 24682bb7a3..4170a31a54 100644 --- a/tests/auto/quick/touchmouse/tst_touchmouse.cpp +++ b/tests/auto/quick/touchmouse/tst_touchmouse.cpp @@ -285,17 +285,16 @@ void tst_TouchMouse::simpleTouchEvent() p1 = QPoint(20, 20); QTest::touchEvent(window, device).press(0, p1, window); QQuickTouchUtils::flush(window); - QCOMPARE(eventItem1->eventList.size(), 3); + QCOMPARE(eventItem1->eventList.size(), 2); QCOMPARE(eventItem1->eventList.at(0).type, QEvent::TouchBegin); QCOMPARE(eventItem1->eventList.at(1).type, QEvent::MouseButtonPress); - QCOMPARE(eventItem1->eventList.at(2).type, QEvent::UngrabMouse); p1 += QPoint(10, 0); QTest::touchEvent(window, device).move(0, p1, window); QQuickTouchUtils::flush(window); - QCOMPARE(eventItem1->eventList.size(), 3); + QCOMPARE(eventItem1->eventList.size(), 2); QTest::touchEvent(window, device).release(0, p1, window); QQuickTouchUtils::flush(window); - QCOMPARE(eventItem1->eventList.size(), 3); + QCOMPARE(eventItem1->eventList.size(), 2); eventItem1->eventList.clear(); // wait to avoid getting a double click event -- cgit v1.2.3