From 262d7eb305e1dea8dac660bec3ccc50193258ea9 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 11 Nov 2020 21:29:11 +0100 Subject: Fix QQWinPriv::deliverSinglePointEventUntilAccepted for wheel, gestures WheelHandler was only reacting to one wheel event between mouse moves, because it got added to the QQPointerHandlerPriv::deviceDeliveryTargets() vector, and was not removed at the beginning of delivery of subsequent events, as QQuickWindowPrivate::deliverPointerEvent() does. (In Qt 5 the equivalent vector was cleared in QQuickPointerMouseEvent::reset().) Wheel events are delivered via deliverSinglePointEventUntilAccepted() (grabbing the wheel is still not implemented). Native gesture events are delivered that way too; and sure enough, the same bug happens on the macOS trackpad, whether you are attempting to do pinch zoom or just two-finger-flick. tst_QQuickWheelHandler::nestedHandler() sends multiple wheel events in a row, so we do have some test coverage, and hopefully this issue explains why it needed to be blacklisted. Fixes: QTBUG-88428 Task-number: QTBUG-86729 Change-Id: Id1ed4a38dfa3eb2253c4a60f09f80aea0f69707e Reviewed-by: Volker Hilsheimer --- src/quick/items/qquickwindow.cpp | 1 + tests/auto/quick/pointerhandlers/qquickwheelhandler/BLACKLIST | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index b283f56ab9..4dab3b731d 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -2209,6 +2209,7 @@ bool QQuickWindowPrivate::deliverHoverEvent(QQuickItem *item, const QPointF &sce bool QQuickWindowPrivate::deliverSinglePointEventUntilAccepted(QPointerEvent *event) { Q_ASSERT(event->points().count() == 1); + QQuickPointerHandlerPrivate::deviceDeliveryTargets(event->pointingDevice()).clear(); QEventPoint &point = event->point(0); QVector targetItems = pointerTargets(contentItem, event, point, false, false); point.setAccepted(false); diff --git a/tests/auto/quick/pointerhandlers/qquickwheelhandler/BLACKLIST b/tests/auto/quick/pointerhandlers/qquickwheelhandler/BLACKLIST index a189ebe041..2949d3371f 100644 --- a/tests/auto/quick/pointerhandlers/qquickwheelhandler/BLACKLIST +++ b/tests/auto/quick/pointerhandlers/qquickwheelhandler/BLACKLIST @@ -1,6 +1,3 @@ # QTBUG-81993 [singleHandler] macos ci -* # QTBUG-86729 -[nestedHandler] -* # QTBUG-86729 -- cgit v1.2.3