From 2ee36539ba4b9938d8579fcab1172db9543a2f5f Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Wed, 12 Oct 2022 10:08:42 -0400 Subject: [PATCH] fix: drag and drop should copy on macOS (#35978) fix: drag and drop should copy on macOS (#35963) Co-authored-by: Shelley Vohr Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr --- 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 4c4649c6cb434..36656ea362941 100644 --- a/shell/browser/ui/drag_util_mac.mm +++ b/shell/browser/ui/drag_util_mac.mm @@ -20,7 +20,8 @@ @implementation DragDownloadItemSource - (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