diff --git a/src/plugins/platforms/cocoa/qcocoadrag.h b/src/plugins/platforms/cocoa/qcocoadrag.h index dedf8a7fd9c..f470fa39a9f 100644 --- a/src/plugins/platforms/cocoa/qcocoadrag.h +++ b/src/plugins/platforms/cocoa/qcocoadrag.h @@ -35,7 +35,7 @@ public: * to meet NSView dragImage:at guarantees, we need to record the original * event and view when handling an event in QNSView */ - void setLastMouseEvent(NSEvent *event, NSView *view); + void setLastInputEvent(NSEvent *event, NSView *view); void setAcceptedAction(Qt::DropAction act); void exitDragLoop(); diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm index 3a9f5a87941..3b736db39b3 100644 --- a/src/plugins/platforms/cocoa/qcocoadrag.mm +++ b/src/plugins/platforms/cocoa/qcocoadrag.mm @@ -31,7 +31,7 @@ QCocoaDrag::~QCocoaDrag() [m_lastEvent release]; } -void QCocoaDrag::setLastMouseEvent(NSEvent *event, NSView *view) +void QCocoaDrag::setLastInputEvent(NSEvent *event, NSView *view) { [m_lastEvent release]; m_lastEvent = [event copy]; diff --git a/src/plugins/platforms/cocoa/qnsview_mouse.mm b/src/plugins/platforms/cocoa/qnsview_mouse.mm index 2fd57fe68e6..c566e499b73 100644 --- a/src/plugins/platforms/cocoa/qnsview_mouse.mm +++ b/src/plugins/platforms/cocoa/qnsview_mouse.mm @@ -117,7 +117,7 @@ static const QPointingDevice *pointingDeviceFor(qint64 deviceID) ulong timestamp = [theEvent timestamp] * 1000; QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag(); - nativeDrag->setLastMouseEvent(theEvent, self); + nativeDrag->setLastInputEvent(theEvent, self); const auto modifiers = QAppleKeyMapper::fromCocoaModifiers(theEvent.modifierFlags); auto button = cocoaButton2QtButton(theEvent); diff --git a/src/plugins/platforms/cocoa/qnsview_tablet.mm b/src/plugins/platforms/cocoa/qnsview_tablet.mm index 4c6e351b3f4..09553aee5f6 100644 --- a/src/plugins/platforms/cocoa/qnsview_tablet.mm +++ b/src/plugins/platforms/cocoa/qnsview_tablet.mm @@ -28,6 +28,9 @@ Q_GLOBAL_STATIC(QCocoaTabletDeviceMap, devicesInProximity) ulong timestamp = [theEvent timestamp] * 1000; + QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag(); + nativeDrag->setLastInputEvent(theEvent, self); + QPointF windowPoint; QPointF screenPoint; [self convertFromScreen:[self screenMousePoint:theEvent] toWindowPoint: &windowPoint andScreenPoint: &screenPoint]; diff --git a/src/plugins/platforms/cocoa/qnsview_touch.mm b/src/plugins/platforms/cocoa/qnsview_touch.mm index 97ed5b76249..5d93d2c688a 100644 --- a/src/plugins/platforms/cocoa/qnsview_touch.mm +++ b/src/plugins/platforms/cocoa/qnsview_touch.mm @@ -37,6 +37,10 @@ Q_LOGGING_CATEGORY(lcQpaTouch, "qt.qpa.input.touch") return; const NSTimeInterval timestamp = [event timestamp]; + + QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag(); + nativeDrag->setLastInputEvent(event, self); + const QList points = QCocoaTouch::getCurrentTouchPointList(event, [self shouldSendSingleTouch]); qCDebug(lcQpaTouch) << "touchesMovedWithEvent" << points << "from device" << Qt::hex << [event deviceID]; QWindowSystemInterface::handleTouchEvent( @@ -51,6 +55,10 @@ Q_LOGGING_CATEGORY(lcQpaTouch, "qt.qpa.input.touch") return; const NSTimeInterval timestamp = [event timestamp]; + + QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag(); + nativeDrag->setLastInputEvent(event, self); + const QList points = QCocoaTouch::getCurrentTouchPointList(event, [self shouldSendSingleTouch]); qCDebug(lcQpaTouch) << "touchesEndedWithEvent" << points << "from device" << Qt::hex << [event deviceID]; QWindowSystemInterface::handleTouchEvent( @@ -65,6 +73,10 @@ Q_LOGGING_CATEGORY(lcQpaTouch, "qt.qpa.input.touch") return; const NSTimeInterval timestamp = [event timestamp]; + + QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag(); + nativeDrag->setLastInputEvent(event, self); + const QList points = QCocoaTouch::getCurrentTouchPointList(event, [self shouldSendSingleTouch]); qCDebug(lcQpaTouch) << "touchesCancelledWithEvent" << points << "from device" << Qt::hex << [event deviceID]; QWindowSystemInterface::handleTouchEvent(