Skip to content

Commit

Permalink
Drag and Drop: Don't let Cocoa override proposed actions
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Jake Petroules <[email protected]>
  • Loading branch information
Gabriel de Dietrich committed Aug 11, 2016
1 parent b6f5b38 commit 23ea54d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/plugins/platforms/cocoa/qnsview.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1922,7 +1922,15 @@ - (NSDragOperation) draggingSourceOperationMaskForLocal:(BOOL)isLocal

- (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
Expand Down

0 comments on commit 23ea54d

Please sign in to comment.