fix: drag and drop should copy on macOS (#35963)
This commit is contained in:
parent
9006f0e0c5
commit
b3fd5eb258
1 changed files with 3 additions and 2 deletions
|
@ -20,7 +20,8 @@
|
||||||
|
|
||||||
- (NSDragOperation)draggingSession:(NSDraggingSession*)session
|
- (NSDragOperation)draggingSession:(NSDraggingSession*)session
|
||||||
sourceOperationMaskForDraggingContext:(NSDraggingContext)context {
|
sourceOperationMaskForDraggingContext:(NSDraggingContext)context {
|
||||||
return NSDragOperationEvery;
|
return context == NSDraggingContextOutsideApplication ? NSDragOperationCopy
|
||||||
|
: NSDragOperationEvery;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -70,7 +71,7 @@ void DragFileItems(const std::vector<base::FilePath>& files,
|
||||||
NSEvent* dragEvent =
|
NSEvent* dragEvent =
|
||||||
[NSEvent mouseEventWithType:NSEventTypeLeftMouseDragged
|
[NSEvent mouseEventWithType:NSEventTypeLeftMouseDragged
|
||||||
location:position
|
location:position
|
||||||
modifierFlags:NSEventMaskLeftMouseDragged
|
modifierFlags:0
|
||||||
timestamp:eventTime
|
timestamp:eventTime
|
||||||
windowNumber:[[native_view window] windowNumber]
|
windowNumber:[[native_view window] windowNumber]
|
||||||
context:nil
|
context:nil
|
||||||
|
|
Loading…
Reference in a new issue