aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/handlers/qquicksinglepointhandler.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-02-16 08:43:08 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2018-07-27 10:43:04 +0000
commitf2ba3bd9792500b4d3fcfd23b03098a32641ef4f (patch)
tree5fdae298618ae42ae6e2d456bb719168377274db /src/quick/handlers/qquicksinglepointhandler.cpp
parent0e1f83dcade8cb6428513eea4452dcd500f9e486 (diff)
PointHandler: stay active as long as acceptedButtons satisfied
Ignore buttons which do not fit the acceptedButtons filter, and do not assume that it's all over when any release happens. Task-number: QTBUG-66360 Change-Id: I871ea7fdd9b76f06fa0d73382617b287c04d35ab Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/handlers/qquicksinglepointhandler.cpp')
-rw-r--r--src/quick/handlers/qquicksinglepointhandler.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/quick/handlers/qquicksinglepointhandler.cpp b/src/quick/handlers/qquicksinglepointhandler.cpp
index fa08ced8e2..177ad21079 100644
--- a/src/quick/handlers/qquicksinglepointhandler.cpp
+++ b/src/quick/handlers/qquicksinglepointhandler.cpp
@@ -129,17 +129,13 @@ void QQuickSinglePointHandler::handlePointerEventImpl(QQuickPointerEvent *event)
QQuickPointerDeviceHandler::handlePointerEventImpl(event);
QQuickEventPoint *currentPoint = event->pointById(m_pointInfo.m_id);
Q_ASSERT(currentPoint);
- if (!m_pointInfo.m_id || !currentPoint->isAccepted()) {
+ m_pointInfo.reset(currentPoint);
+ handleEventPoint(currentPoint);
+ if (currentPoint->state() == QQuickEventPoint::Released && (event->buttons() & acceptedButtons()) == Qt::NoButton) {
+ setExclusiveGrab(currentPoint, false);
reset();
- } else {
- m_pointInfo.reset(currentPoint);
- handleEventPoint(currentPoint);
- if (currentPoint->state() == QQuickEventPoint::Released) {
- setExclusiveGrab(currentPoint, false);
- reset();
- }
- emit pointChanged();
}
+ emit pointChanged();
}
void QQuickSinglePointHandler::onGrabChanged(QQuickPointerHandler *grabber, QQuickEventPoint::GrabState stateChange, QQuickEventPoint *point)