diff options
-rw-r--r-- | src/quick/handlers/qquickpointerhandler.cpp | 2 | ||||
-rw-r--r-- | src/quick/handlers/qquicktaphandler.cpp | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/quick/handlers/qquickpointerhandler.cpp b/src/quick/handlers/qquickpointerhandler.cpp index f625b50f10..8f113ddd56 100644 --- a/src/quick/handlers/qquickpointerhandler.cpp +++ b/src/quick/handlers/qquickpointerhandler.cpp @@ -205,7 +205,7 @@ void QQuickPointerHandler::handlePointerEvent(QQuickPointerEvent *event) int pCount = event->pointCount(); for (int i = 0; i < pCount; ++i) { QQuickEventPoint *pt = event->point(i); - if (pt->grabberPointerHandler() == this) + if (pt->grabberPointerHandler() == this && pt->state() != QQuickEventPoint::Stationary) pt->cancelExclusiveGrab(); } } diff --git a/src/quick/handlers/qquicktaphandler.cpp b/src/quick/handlers/qquicktaphandler.cpp index aeda9a0357..14aeb07864 100644 --- a/src/quick/handlers/qquicktaphandler.cpp +++ b/src/quick/handlers/qquicktaphandler.cpp @@ -120,7 +120,7 @@ bool QQuickTapHandler::wantsEventPoint(QQuickEventPoint *point) case QQuickEventPoint::Released: ret = parentContains(point); break; - default: // update or stationary + case QQuickEventPoint::Updated: switch (m_gesturePolicy) { case DragThreshold: ret = !dragOverThreshold(point); @@ -133,12 +133,18 @@ bool QQuickTapHandler::wantsEventPoint(QQuickEventPoint *point) break; } break; + case QQuickEventPoint::Stationary: + // Never react in any way when the point hasn't moved. + // In autotests, the point's position may not even be correct, because + // QTest::touchEvent(window, touchDevice).stationary(1) + // provides no opportunity to give a position, so it ends up being random. + break; } // If this is the grabber, returning false from this function will cancel the grab, // so onGrabChanged(this, CancelGrabExclusive, point) and setPressed(false) will be called. // But when m_gesturePolicy is DragThreshold, we don't get an exclusive grab, but // we still don't want to be pressed anymore. - if (!ret && point->pointId() == pointId()) + if (!ret && point->pointId() == pointId() && point->state() != QQuickEventPoint::Stationary) setPressed(false, true, point); return ret; } |