From 3e91062877c0853aff693799bc5e33cdf7aaad42 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 6 Feb 2018 16:46:47 +0100 Subject: skip filtering during post-delivery if there are no PointerHandlers In QQuickWindowPrivate::deliverMouseEvent() we call childMouseEventFilter on parents of items which have pointer handlers before we give the pointer handlers one last chance to handle un-handled events. This last-chance delivery is a new feature in 5.10. (Maybe letting filtering happen in that scenario is dubious anyway. The reason it was done in 7042cfd9cb1b552c5fd753b6912439ce604eb1a0 was to allow Flickable to steal the grab from a passively-grabbing TapHandler.) But certainly if there aren't any pointer handlers as children of an item, it doesn't make sense to let the item's ancestors do filtering because in 5.9 and previous versions they would not have gotten that chance. Task-number: QTBUG-65651 Change-Id: I7a14a1f6cac03bf9beb4fa9ab47193df1bd773a8 Reviewed-by: Paolo Angelelli --- src/quick/items/qquickwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/quick/items/qquickwindow.cpp') diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index c981bfc67e..285d49a60a 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -1756,6 +1756,8 @@ void QQuickWindowPrivate::deliverMouseEvent(QQuickPointerMouseEvent *pointerEven QVector targetItems = pointerTargets(contentItem, point->scenePosition(), false, false); for (QQuickItem *item : targetItems) { QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item); + if (!itemPrivate->extra.isAllocated() || itemPrivate->extra->pointerHandlers.isEmpty()) + continue; pointerEvent->localize(item); if (!sendFilteredPointerEvent(pointerEvent, item)) { if (itemPrivate->handlePointerEvent(pointerEvent, true)) // avoid re-delivering to grabbers -- cgit v1.2.3