diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2024-03-19 23:47:29 -0700 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2024-03-26 13:33:04 -0700 |
commit | 1f7a34d20ad39dec7aac959facf0064c7d68be60 (patch) | |
tree | ade62c43be0368cf0fe2c08efa47a200a32f32b7 /src/quick/handlers/qquickdraghandler.cpp | |
parent | 357f0cd6ee4e9a99b63bece9db86a6d505594a04 (diff) |
DragHandler: don't skip passive grab if state includes release
If QQuickDragHandler::handlePointerEventImpl() is looking at an event
with one released point and one stationary point, and minimumPointCount
is 1, then it needs to have a passive grab of the stationary point
in case it starts moving. The released point is irrelevant: it's not
in d->currentPoints. We cannot rely on QTouchEvent::isEndEvent()
as a precheck, because m_touchPointStates is Stationary | Released,
and that includes Released, but it's not true that the whole touch
sequence is ending.
Fixes: QTBUG-123499
Change-Id: I20aeecc1f9c29200c324f3f7dc1e6b73fed21d30
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Diffstat (limited to 'src/quick/handlers/qquickdraghandler.cpp')
-rw-r--r-- | src/quick/handlers/qquickdraghandler.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/quick/handlers/qquickdraghandler.cpp b/src/quick/handlers/qquickdraghandler.cpp index 045640cbed..5e9d6d8230 100644 --- a/src/quick/handlers/qquickdraghandler.cpp +++ b/src/quick/handlers/qquickdraghandler.cpp @@ -184,7 +184,9 @@ void QQuickDragHandler::handlePointerEventImpl(QPointerEvent *event) // and in approximately the same direction qreal minAngle = 361; qreal maxAngle = -361; - bool allOverThreshold = !event->isEndEvent(); + bool allOverThreshold = QQuickDeliveryAgentPrivate::isTouchEvent(event) ? + static_cast<QTouchEvent *>(event)->touchPointStates() != QEventPoint::Released : + !event->isEndEvent(); QVector<QEventPoint> chosenPoints; if (event->isBeginEvent()) |