aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2019-04-03 16:16:19 +0200
committerJan Arve Sæther <jan-arve.saether@qt.io>2019-04-04 13:13:18 +0000
commitaba6cea90e023c99ac55b0e8dcdeae0af8305ef2 (patch)
tree7215ab679ea62eebe021d65b3fd221f3155eeff4 /src/quick
parent14109aaccc37df53a0c4b591dddd68b41ec20ec3 (diff)
In response to touch cancel, don't just ungrab, send an ungrab event
QQuickWindowPrivate::sendUngrabEvent() sends an UngrabMouse event, and that can be filtered by parent filters. If a touch cancel happens to a MouseArea in a ListView delegate, we need the ListView to filter the UngrabMouse event so that QQuickFlickable::childMouseEventFilter() will call QQuickFlickable::mouseUngrabEvent() and QQuickFlickablePrivate::cancelInteraction() will set pressed to false. The pressed state became true because Flickable filtered the press event; so for symmetry, it also needs to filter the touch cancel (in the form of a mouse ungrab), to avoid being stuck in a state where it can't move programmatically. Fixes: QTBUG-74679 Change-Id: I6c0ed364d2bc1f45c7e7b17846a09f6b53f91d0a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/items/qquickwindow.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index fa9aa88faa..c6bfcaa647 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -2017,8 +2017,8 @@ bool QQuickWindowPrivate::deliverTouchCancelEvent(QTouchEvent *event)
qCDebug(DBG_TOUCH) << event;
Q_Q(QQuickWindow);
- if (q->mouseGrabberItem())
- q->mouseGrabberItem()->ungrabMouse();
+ if (QQuickItem *grabber = q->mouseGrabberItem())
+ sendUngrabEvent(grabber, true);
cancelTouchMouseSynthesis();
// A TouchCancel event will typically not contain any points.