From 8483a1ea8271d45edd89e97ddd37edc73b83ce99 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 20 Jan 2021 14:13:44 +0100 Subject: Ensure we cancel touchMouseSynthesis upon receiving touchCancel As it stood, we wouldn't cancel touchMouseSynthesis after receiving a touch cancel event. The result would be that the first touch event sent to QQuickWindow thereafter would have touchMouseId set to value different from -1. This again would fool QQuickWindow into believing that the event belonged to a touch event it has synthesized before, and it would as such take a different/wrong path for delivery. This caused text selection to fail on iOS, since a press-and-hold on a line edit from QPA would cancel the touch event and show a magnifier glass. When the user later touched inside the line edit again to move the cursor, this new touch event would not be delivered to the text edit. Fixes: QTBUG-90485 Change-Id: Iad640ae57317ea86ee68ca053654b0b30ade003a Reviewed-by: Shawn Rutledge (cherry picked from commit a738c3566790c6e9abeea3c4c3dacfceaa82f66a) Reviewed-by: Qt Cherry-pick Bot --- src/quick/items/qquickwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 470d43efd5..0270f41e55 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -2282,7 +2282,7 @@ bool QQuickWindowPrivate::deliverTouchCancelEvent(QTouchEvent *event) // Deliver it to all items and handlers that have active touches. const_cast(QPointingDevicePrivate::get(event->pointingDevice()))-> sendTouchCancelEvent(event); - + cancelTouchMouseSynthesis(); return true; } -- cgit v1.2.3