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>
This commit is contained in:
Gabriel de Dietrich 2016-08-05 16:18:50 -07:00
parent b6f5b38f8c
commit 23ea54d861

View File

@ -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 sources
// 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