summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@qt.io>2016-08-05 16:18:50 -0700
committerGabriel de Dietrich <gabriel.dedietrich@qt.io>2016-08-11 17:24:04 +0000
commit23ea54d861be1b68e5df4264c75e0e8d0f5d3c04 (patch)
tree3cbbd0f3424de7ed629932cfa93976493706e3ff /src/plugins/platforms/cocoa
parentb6f5b38f8c883f5c82d9dc0332f55521f59b70db (diff)
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 <timur.pocheptsov@theqtcompany.com> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm10
1 files changed, 9 insertions, 1 deletions
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