diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2017-12-14 12:22:52 +0100 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2018-02-07 13:48:35 +0000 |
commit | c223fdd9171999cb84b00fc3972f5bfb0c2bf71e (patch) | |
tree | f86ede554288894ac646c48789980f1c46fceb86 /src/plugins/platforms/cocoa/qnsview.mm | |
parent | 9bd702a634636095e84195bd76c7e745af287968 (diff) |
Cocoa: move setting of drag accepted state
performDragOperation:sender is called when an application
window receives a drop, either from an application
sourced drag or from a foreign drag.
draggingSession:endedAtPoint:operation is called when
an application sourced drag ends, either on an application
window or on a foreign window.
Update the drag accepted state when the session ends
in order to handle DnD from the application to a
non-application window.
Task-number: QTBUG-63794
Change-Id: If3e16ed6a086c5d051e7390e3ecf16ea210221ad
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qnsview.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.mm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 32f73759c2..af16ed103e 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -2004,10 +2004,6 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin QCocoaDropData mimeData([sender draggingPasteboard]); response = QWindowSystemInterface::handleDrop(target, &mimeData, mapWindowCoordinates(m_platformWindow->window(), target, qt_windowPoint), qtAllowed); } - if (response.isAccepted()) { - QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag(); - nativeDrag->setAcceptedAction(response.acceptedAction()); - } return response.isAccepted(); } @@ -2025,6 +2021,9 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin if (!target) return; + QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag(); + nativeDrag->setAcceptedAction(qt_mac_mapNSDragOperation(operation)); + // keep our state, and QGuiApplication state (buttons member) in-sync, // or future mouse events will be processed incorrectly NSUInteger pmb = [NSEvent pressedMouseButtons]; |