Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Commit

Permalink
fix: drag and drop should copy on macOS (electron#35963)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere authored and khalwa committed Feb 22, 2023
1 parent 835eaf3 commit 4897c87
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions shell/browser/ui/drag_util_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ @implementation DragDownloadItemSource

- (NSDragOperation)draggingSession:(NSDraggingSession*)session
sourceOperationMaskForDraggingContext:(NSDraggingContext)context {
return NSDragOperationEvery;
return context == NSDraggingContextOutsideApplication ? NSDragOperationCopy
: NSDragOperationEvery;
}

@end
Expand Down Expand Up @@ -70,7 +71,7 @@ void DragFileItems(const std::vector<base::FilePath>& files,
NSEvent* dragEvent =
[NSEvent mouseEventWithType:NSEventTypeLeftMouseDragged
location:position
modifierFlags:NSEventMaskLeftMouseDragged
modifierFlags:0
timestamp:eventTime
windowNumber:[[native_view window] windowNumber]
context:nil
Expand Down

0 comments on commit 4897c87

Please sign in to comment.