summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNyx0uf <Nyx0uf@users.noreply.github.com>2016-04-28 13:45:43 +0200
committerwm4 <wm4@nowhere>2016-04-30 18:58:06 +0200
commited695ce689fd11681bfe4937b5ddca105b9db83a (patch)
tree6895078906fc952a19547890d7a37b33ecfebef4
parent949247d6e63d3742fef7211bd3a43fa9b1f1d490 (diff)
downloadmpv-ed695ce689fd11681bfe4937b5ddca105b9db83a.tar.bz2
mpv-ed695ce689fd11681bfe4937b5ddca105b9db83a.tar.xz
os x: handle multiple dropped files on the window
Should fix #3076 (partially). Signed-off-by: wm4 <wm4@nowhere>
-rw-r--r--video/out/cocoa/events_view.m9
1 files changed, 7 insertions, 2 deletions
diff --git a/video/out/cocoa/events_view.m b/video/out/cocoa/events_view.m
index 6fec712a33..4a0c4bfe04 100644
--- a/video/out/cocoa/events_view.m
+++ b/video/out/cocoa/events_view.m
@@ -358,8 +358,13 @@
{
NSPasteboard *pboard = [sender draggingPasteboard];
if ([[pboard types] containsObject:NSURLPboardType]) {
- NSURL *file_url = [NSURL URLFromPasteboard:pboard];
- [self.adapter handleFilesArray:@[[file_url absoluteString]]];
+ NSArray *pbitems = [pboard readObjectsForClasses:@[[NSURL class]]
+ options:@{}];
+ NSMutableArray* ar = [[[NSMutableArray alloc] init] autorelease];
+ for (NSURL* url in pbitems) {
+ [ar addObject:[url path]];
+ }
+ [self.adapter handleFilesArray:ar];
return YES;
} else if ([[pboard types] containsObject:NSFilenamesPboardType]) {
NSArray *pbitems = [pboard propertyListForType:NSFilenamesPboardType];