mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-28 23:13:18 +08:00
os x: handle multiple dropped files on the window
Should fix #3076 (partially). Signed-off-by: wm4 <wm4@nowhere>
This commit is contained in:
@@ -358,8 +358,13 @@
|
|||||||
{
|
{
|
||||||
NSPasteboard *pboard = [sender draggingPasteboard];
|
NSPasteboard *pboard = [sender draggingPasteboard];
|
||||||
if ([[pboard types] containsObject:NSURLPboardType]) {
|
if ([[pboard types] containsObject:NSURLPboardType]) {
|
||||||
NSURL *file_url = [NSURL URLFromPasteboard:pboard];
|
NSArray *pbitems = [pboard readObjectsForClasses:@[[NSURL class]]
|
||||||
[self.adapter handleFilesArray:@[[file_url absoluteString]]];
|
options:@{}];
|
||||||
|
NSMutableArray* ar = [[[NSMutableArray alloc] init] autorelease];
|
||||||
|
for (NSURL* url in pbitems) {
|
||||||
|
[ar addObject:[url path]];
|
||||||
|
}
|
||||||
|
[self.adapter handleFilesArray:ar];
|
||||||
return YES;
|
return YES;
|
||||||
} else if ([[pboard types] containsObject:NSFilenamesPboardType]) {
|
} else if ([[pboard types] containsObject:NSFilenamesPboardType]) {
|
||||||
NSArray *pbitems = [pboard propertyListForType:NSFilenamesPboardType];
|
NSArray *pbitems = [pboard propertyListForType:NSFilenamesPboardType];
|
||||||
|
|||||||
Reference in New Issue
Block a user