diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-12-12 22:41:13 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-12-13 16:16:46 +0000 |
commit | 358a72b6ecd0fef69edf5355f299af10225a6c8b (patch) | |
tree | 93fb26b8f481218434490662473a6db78d094b30 /src | |
parent | b1494ffa7d0c9bfa68019a3fc4969f9124d4889c (diff) |
PointHandler: distribute simultaneous touch presses properly
If multiple touchpoints are pressed simultaneously, each point can
be grabbed by one PointHandler instance. Each PointHandler instance
cannot grab more than one point, nor grab a point that is already
chosen by another PointHandler. This was always the intention, but
got broken (perhaps by 3523b676382db4aa39adeb9126d8bb2185e84403),
and there was no test coverage of this case until now.
Fixes: QTBUG-71431
Change-Id: I6d7614eb4767c677d929291f917cf62d9c03bd93
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/handlers/qquicksinglepointhandler.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/handlers/qquicksinglepointhandler.cpp b/src/quick/handlers/qquicksinglepointhandler.cpp index 82e5b1b05d..ae162bed87 100644 --- a/src/quick/handlers/qquicksinglepointhandler.cpp +++ b/src/quick/handlers/qquicksinglepointhandler.cpp @@ -108,7 +108,7 @@ bool QQuickSinglePointHandler::wantsPointerEvent(QQuickPointerEvent *event) int candidatePointCount = 0; int c = event->pointCount(); QQuickEventPoint *chosen = nullptr; - for (int i = 0; i < c; ++i) { + for (int i = 0; i < c && !chosen; ++i) { QQuickEventPoint *p = event->point(i); if (!p->exclusiveGrabber() && wantsEventPoint(p)) { if (!chosen) |