summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qpointingdevice_p.h
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2021-04-19 16:00:35 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2021-04-28 13:00:45 +0200
commit40330b8f0a717098982d1f54f34a18a8262b1f55 (patch)
tree3c64634f4876f533e168b577579ae2720aef5711 /src/gui/kernel/qpointingdevice_p.h
parentbb5d2af7677a14f2aaeffb0e29679d9dcce692e6 (diff)
Add grabber context pointers
In Qt Quick we now need to keep track of which QQDeliveryAgent is responsible when a point is grabbed, either passively or exclusively. When we re-deliver to that grabber, we need to do it via the same agent, so that the same scene transform is used, and the grabber will see the event in the correct coordinate system. It's easier to track this mapping here instead of in a separate map in Qt Quick. Pick-to: 6.1 Task-number: QTBUG-92944 Change-Id: I69f769c694d0da24885cdf4087e5032022bff629 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/gui/kernel/qpointingdevice_p.h')
-rw-r--r--src/gui/kernel/qpointingdevice_p.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/kernel/qpointingdevice_p.h b/src/gui/kernel/qpointingdevice_p.h
index 04823a3e86..d67dedf9e1 100644
--- a/src/gui/kernel/qpointingdevice_p.h
+++ b/src/gui/kernel/qpointingdevice_p.h
@@ -85,10 +85,12 @@ public:
/*! \internal
This struct (stored in activePoints) holds persistent state between event deliveries.
*/
+ using PassiveGrabbersMap = QFlatMap<QPointer<QObject>, QPointer<QObject>>;
struct EventPointData {
QEventPoint eventPoint;
QPointer<QObject> exclusiveGrabber;
- QList<QPointer <QObject> > passiveGrabbers;
+ QPointer<QObject> exclusiveGrabberContext; // extra info about where the grab happened
+ PassiveGrabbersMap passiveGrabbers; // key: passive grabber; value: context (where the grab happened)
};
EventPointData *queryPointById(int id) const;
EventPointData *pointById(int id) const;