mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: drag and drop should copy on macOS (#35976)
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>
This commit is contained in:
@@ -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<base::FilePath>& files,
|
||||
NSEvent* dragEvent =
|
||||
[NSEvent mouseEventWithType:NSEventTypeLeftMouseDragged
|
||||
location:position
|
||||
modifierFlags:NSEventMaskLeftMouseDragged
|
||||
modifierFlags:0
|
||||
timestamp:eventTime
|
||||
windowNumber:[[native_view window] windowNumber]
|
||||
context:nil
|
||||
|
||||
Reference in New Issue
Block a user