From add3c046c4b5bb3111b98f90163de1b0d96fa3cb Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Tue, 11 Oct 2022 16:20:54 +0000 Subject: [PATCH] fix: drag and drop should copy on macOS (#35963) 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