diff --git a/src/gui/kernel/qpointingdevice.cpp b/src/gui/kernel/qpointingdevice.cpp index 126c2838d4e..e43cb7013a3 100644 --- a/src/gui/kernel/qpointingdevice.cpp +++ b/src/gui/kernel/qpointingdevice.cpp @@ -498,6 +498,7 @@ void QPointingDevicePrivate::setExclusiveGrabber(const QPointerEvent *event, con qWarning() << "point is not in activePoints" << point; return; } + Q_ASSERT(persistentPoint->eventPoint.id() == point.id()); if (persistentPoint->exclusiveGrabber == exclusiveGrabber) return; auto oldGrabber = persistentPoint->exclusiveGrabber; diff --git a/src/gui/kernel/qpointingdevice_p.h b/src/gui/kernel/qpointingdevice_p.h index a9c4a1fa846..f633327f27c 100644 --- a/src/gui/kernel/qpointingdevice_p.h +++ b/src/gui/kernel/qpointingdevice_p.h @@ -108,7 +108,7 @@ public: void clearPassiveGrabbers(const QPointerEvent *event, const QEventPoint &point); void removeGrabber(QObject *grabber, bool cancel = false); - using EventPointMap = QFlatMap; + using EventPointMap = QVarLengthFlatMap; mutable EventPointMap activePoints; QPointingDeviceUniqueId uniqueId;