summaryrefslogtreecommitdiffstats
path: root/platform/osx/display_server_osx.mm
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2020-06-23 22:01:42 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2020-06-29 12:33:51 +0300
commit00299f15b46b695d6809f7f812daaad1ad520b4a (patch)
tree527781843f15ef421089ca02b119583d9e8e815e /platform/osx/display_server_osx.mm
parent9fc65fd1f15b2ae2e26cf69c54819e7d6598fa05 (diff)
downloadredot-engine-00299f15b46b695d6809f7f812daaad1ad520b4a.tar.gz
[macOS] Add support for the Apple Silicon (ARM64) build target.
Diffstat (limited to 'platform/osx/display_server_osx.mm')
-rw-r--r--platform/osx/display_server_osx.mm12
1 files changed, 12 insertions, 0 deletions
diff --git a/platform/osx/display_server_osx.mm b/platform/osx/display_server_osx.mm
index 920fd24c4a..5f97483ff4 100644
--- a/platform/osx/display_server_osx.mm
+++ b/platform/osx/display_server_osx.mm
@@ -566,7 +566,11 @@ static NSCursor *_cursorFromSelector(SEL selector, SEL fallback = nil) {
trackingArea = nil;
imeInputEventInProgress = false;
[self updateTrackingAreas];
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+ [self registerForDraggedTypes:[NSArray arrayWithObject:NSPasteboardTypeFileURL]];
+#else
[self registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]];
+#endif
markedText = [[NSMutableAttributedString alloc] init];
return self;
}
@@ -723,11 +727,19 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
DisplayServerOSX::WindowData &wd = DS_OSX->windows[window_id];
NSPasteboard *pboard = [sender draggingPasteboard];
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+ NSArray<NSURL *> *filenames = [pboard propertyListForType:NSPasteboardTypeFileURL];
+#else
NSArray *filenames = [pboard propertyListForType:NSFilenamesPboardType];
+#endif
Vector<String> files;
for (NSUInteger i = 0; i < filenames.count; i++) {
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+ NSString *ns = [[filenames objectAtIndex:i] path];
+#else
NSString *ns = [filenames objectAtIndex:i];
+#endif
char *utfs = strdup([ns UTF8String]);
String ret;
ret.parse_utf8(utfs);