aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/handlers/qquickpointerhandler.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-08-01 21:02:31 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2018-08-02 17:48:20 +0000
commit6008c5ded48b6d03d56bf4c4ab96177fbb185f93 (patch)
tree99dc028580b9fba6bd8cb37fc1f14b909aeb928d /src/quick/handlers/qquickpointerhandler.cpp
parentea195452e80e4b5a70e8c8cdf96a30581a8dd456 (diff)
MultiPointHandler::wantsPointerEvent: reset if different cand count
We always intended to "start over" with event delivery when the number of touchpoints changes. Change 48011c2dfeb83b4fe717034d4b3c353714fead48 began this process, but in addition to QQuickWindow delivering the event to all items and their handlers in reverse paint order, ignoring existing grabs, the handlers themselves have responsibility to act as if it was an initial press whenever the number of relevant touchpoints changes; and because QQuickWindow starts over, handlers do not need to rely on passive grabs to retain interest in one point at the time when a transition to a different number of points occurs. For example, DragHandler by default handles just one point, so if you press one point such that it takes a passive grab and adds that point to m_currentPoints, then you press a second finger within the bounds of the same parentItem, the DragHandler should not go on "wanting" the first point anymore, because a two-finger gesture is different, and not suitable for the DragHandler unless its maximumPointCount >= 2. Even if the second point is released, QQuickWindow will "start over" with delivery, so a multi-point handler does not need to rely on retaining a passive grab to handle the transition from two points back to one again. This also helps enable smoother transitions between different gestures: e.g. in the map.qml manual test, you can drag one finger and transition from dragging to pinching and back while the second finger is pressed, dragged and released. Change-Id: Id9b8f30029ed1ff9fd2d64a5e413a47055622083 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/handlers/qquickpointerhandler.cpp')
-rw-r--r--src/quick/handlers/qquickpointerhandler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/handlers/qquickpointerhandler.cpp b/src/quick/handlers/qquickpointerhandler.cpp
index 0be3c05e96..db58046e81 100644
--- a/src/quick/handlers/qquickpointerhandler.cpp
+++ b/src/quick/handlers/qquickpointerhandler.cpp
@@ -453,7 +453,7 @@ bool QQuickPointerHandler::wantsPointerEvent(QQuickPointerEvent *event)
bool QQuickPointerHandler::wantsEventPoint(QQuickEventPoint *point)
{
- bool ret = parentContains(point);
+ bool ret = point->exclusiveGrabber() == this || point->passiveGrabbers().contains(this) || parentContains(point);
qCDebug(lcPointerHandlerDispatch) << hex << point->pointId() << "@" << point->scenePosition()
<< metaObject()->className() << objectName() << ret;
return ret;