From 23ea54d861be1b68e5df4264c75e0e8d0f5d3c04 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Fri, 5 Aug 2016 16:18:50 -0700 Subject: Drag and Drop: Don't let Cocoa override proposed actions When pressing the Command key, or any other modifier key, Cocoa will filter whatever the application has set in the QDrag object. However, Qt is already taking all this into account, so we should not let yet another voice chime in. Task-number: QTBUG-55177 Change-Id: I7c56e72d846d10cdfc132776bdfdd6b79799bcff Reviewed-by: Timur Pocheptsov Reviewed-by: Jake Petroules --- src/plugins/platforms/cocoa/qnsview.mm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 913ce08d17..784b1ca14b 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -1922,7 +1922,15 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin - (BOOL) ignoreModifierKeysWhileDragging { - return NO; + // According to the "Dragging Sources" chapter on Cocoa DnD Programming + // (https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/DragandDrop/Concepts/dragsource.html), + // if the control, option, or command key is pressed, the source’s + // operation mask is filtered to only contain a reduced set of operations. + // + // Since Qt already takes care of tracking the keyboard modifiers, we + // don't need (or want) Cocoa to filter anything. Instead, we'll let + // the application do the actual filtering. + return YES; } - (BOOL)wantsPeriodicDraggingUpdates -- cgit v1.2.3