Skip to content

Commit

Permalink
fix: drag and drop should copy on macOS (#35978)
Browse files Browse the repository at this point in the history
fix: drag and drop should copy on macOS (#35963)

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
  • Loading branch information
trop[bot] and codebytere committed Oct 12, 2022
1 parent 0d05ce8 commit 2ee3653
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions shell/browser/ui/drag_util_mac.mm
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 2ee3653

Please sign in to comment.