From b3fd5eb2585aabb9182d6941c6da3f688fa3f5bb Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 11 Oct 2022 09:19:59 -0700 Subject: [PATCH] fix: drag and drop should copy on macOS (#35963) --- shell/browser/ui/drag_util_mac.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shell/browser/ui/drag_util_mac.mm b/shell/browser/ui/drag_util_mac.mm index 4c4649c6cb43..36656ea36294 100644 --- a/shell/browser/ui/drag_util_mac.mm +++ b/shell/browser/ui/drag_util_mac.mm @@ -20,7 +20,8 @@ - (NSDragOperation)draggingSession:(NSDraggingSession*)session sourceOperationMaskForDraggingContext:(NSDraggingContext)context { - return NSDragOperationEvery; + return context == NSDraggingContextOutsideApplication ? NSDragOperationCopy + : NSDragOperationEvery; } @end @@ -70,7 +71,7 @@ void DragFileItems(const std::vector& files, NSEvent* dragEvent = [NSEvent mouseEventWithType:NSEventTypeLeftMouseDragged location:position - modifierFlags:NSEventMaskLeftMouseDragged + modifierFlags:0 timestamp:eventTime windowNumber:[[native_view window] windowNumber] context:nil