|
@@ -115,13 +115,7 @@
|
|
self.layerContentsRedrawPolicy = NSViewLayerContentsRedrawDuringViewResize;
|
|
self.layerContentsRedrawPolicy = NSViewLayerContentsRedrawDuringViewResize;
|
|
self.layerContentsPlacement = NSViewLayerContentsPlacementTopLeft;
|
|
self.layerContentsPlacement = NSViewLayerContentsPlacementTopLeft;
|
|
|
|
|
|
- if (@available(macOS 10.13, *)) {
|
|
|
|
- [self registerForDraggedTypes:[NSArray arrayWithObject:NSPasteboardTypeFileURL]];
|
|
|
|
-#if !defined(__aarch64__) // Do not build deprectead 10.13 code on ARM.
|
|
|
|
- } else {
|
|
|
|
- [self registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]];
|
|
|
|
-#endif
|
|
|
|
- }
|
|
|
|
|
|
+ [self registerForDraggedTypes:[NSArray arrayWithObject:NSPasteboardTypeFileURL]];
|
|
marked_text = [[NSMutableAttributedString alloc] init];
|
|
marked_text = [[NSMutableAttributedString alloc] init];
|
|
return self;
|
|
return self;
|
|
}
|
|
}
|
|
@@ -321,20 +315,11 @@
|
|
Vector<String> files;
|
|
Vector<String> files;
|
|
NSPasteboard *pboard = [sender draggingPasteboard];
|
|
NSPasteboard *pboard = [sender draggingPasteboard];
|
|
|
|
|
|
- if (@available(macOS 10.13, *)) {
|
|
|
|
- NSArray *items = pboard.pasteboardItems;
|
|
|
|
- for (NSPasteboardItem *item in items) {
|
|
|
|
- NSString *url = [item stringForType:NSPasteboardTypeFileURL];
|
|
|
|
- NSString *file = [NSURL URLWithString:url].path;
|
|
|
|
- files.push_back(String::utf8([file UTF8String]));
|
|
|
|
- }
|
|
|
|
-#if !defined(__aarch64__) // Do not build deprectead 10.13 code on ARM.
|
|
|
|
- } else {
|
|
|
|
- NSArray *filenames = [pboard propertyListForType:NSFilenamesPboardType];
|
|
|
|
- for (NSString *file in filenames) {
|
|
|
|
- files.push_back(String::utf8([file UTF8String]));
|
|
|
|
- }
|
|
|
|
-#endif
|
|
|
|
|
|
+ NSArray *items = pboard.pasteboardItems;
|
|
|
|
+ for (NSPasteboardItem *item in items) {
|
|
|
|
+ NSString *url = [item stringForType:NSPasteboardTypeFileURL];
|
|
|
|
+ NSString *file = [NSURL URLWithString:url].path;
|
|
|
|
+ files.push_back(String::utf8([file UTF8String]));
|
|
}
|
|
}
|
|
|
|
|
|
Variant v = files;
|
|
Variant v = files;
|