From 390ac50d486e35910822402264e33fe74be07198 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Mon, 23 Nov 2020 10:24:31 +0100 Subject: Don't deliver to non-grabbing pointerhandlers if a point is grabbed In particular, on press when QQuickFlickable::filterPointerEvent() calls captureDelayedPress() and will return true, it also accepts the event to stop propagation. It becomes the grabber as a consequence of that. On a future move event, when the drag threshold is exceeded while the delayed press timer is still running, Flickable already has the grab (but it accepts the event again), and QQuickFlickablePrivate::drag() calls setKeepMouseGrab(true). In this case we still want to prevent any children's DragHandlers from seeing the event, because a DragHandler will also see that the drag threshold was exceeded and try to steal the grab. A DragHandler can steal the grab only if there was no press delay: then it sees the initial press because Flickable does NOT stop event propagation (does not accept the event), so it can take a passive grab and continue to wait for the drag threshold to be exceeded, regardless of what else happens. In case of multiple touchpoints, allPointsGrabbed() returns false if the Flickable has only grabbed one point; but we want to avoid delivering handlers in children just on the basis of that grabbed touchpoint being within their bounds, even though other points may be delivered to various handlers. This fixes tst_FlickableInterop::touchAndDragHandlerOnFlickable. The blacklisting of dragHandlerInSiblingStealingGrabFromMouseAreaViaTouch was bogus (it's in the mousearea_interop test). Task-number: QTBUG-86729 Change-Id: I9f0d42e97de4f4a3b4f7773800a8d59dc34a0553 Reviewed-by: Qt CI Bot Reviewed-by: Fabian Kosmale (cherry picked from commit c5c05498a7e79c1868551192921a42236ecbf5f8) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/quick/pointerhandlers/flickableinterop/BLACKLIST | 4 ---- 1 file changed, 4 deletions(-) (limited to 'tests') diff --git a/tests/auto/quick/pointerhandlers/flickableinterop/BLACKLIST b/tests/auto/quick/pointerhandlers/flickableinterop/BLACKLIST index a992fbf137..47c11f14d8 100644 --- a/tests/auto/quick/pointerhandlers/flickableinterop/BLACKLIST +++ b/tests/auto/quick/pointerhandlers/flickableinterop/BLACKLIST @@ -9,7 +9,3 @@ windows gcc macos # QTBUG-86729 [touchDragSliderAndFlickable] * # QTBUG-86729 -[touchAndDragHandlerOnFlickable] -* # QTBUG-86729 -[dragHandlerInSiblingStealingGrabFromMouseAreaViaTouch] -* # QTBUG-86729 -- cgit v1.2.3