aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/quick/items/qquickwindow.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 4210ba36ad..143c76cb1b 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -1976,15 +1976,16 @@ bool QQuickWindowPrivate::deliverTouchCancelEvent(QTouchEvent *event)
qCDebug(DBG_TOUCH) << event;
Q_Q(QQuickWindow);
+ if (q->mouseGrabberItem())
+ q->mouseGrabberItem()->ungrabMouse();
+ touchMouseId = -1;
+ touchMouseDevice = nullptr;
+
// A TouchCancel event will typically not contain any points.
// Deliver it to all items and handlers that have active touches.
QQuickPointerEvent *pointerEvent = pointerEventInstance(QQuickPointerDevice::touchDevice(event->device()));
for (int i = 0; i < pointerEvent->pointCount(); ++i)
pointerEvent->point(i)->cancelExclusiveGrabImpl(event);
- touchMouseId = -1;
- touchMouseDevice = nullptr;
- if (q->mouseGrabberItem())
- q->mouseGrabberItem()->ungrabMouse();
// The next touch event can only be a TouchBegin, so clean up.
pointerEvent->clearGrabbers();