summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-02-06 16:46:47 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2018-02-06 18:49:18 +0000
commit3e91062877c0853aff693799bc5e33cdf7aaad42 (patch)
tree13e3dfa4b332c93d792ab1568f2d1642a3cf3727
parentdafb231eaa6868820fbb279e3c400860cafe8993 (diff)
skip filtering during post-delivery if there are no PointerHandlersv5.10.1
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 <paolo.angelelli@qt.io>
-rw-r--r--src/quick/items/qquickwindow.cpp2
1 files changed, 2 insertions, 0 deletions
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<QQuickItem *> 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