aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa/ScintillaView.mm
diff options
context:
space:
mode:
authorNeil Hodgson <nyamatongwe@gmail.com>2023-02-24 10:25:54 +1100
committerNeil Hodgson <nyamatongwe@gmail.com>2023-02-24 10:25:54 +1100
commit778dc10b3ee2f621d8548b1d074429c44bd3ae62 (patch)
tree9f7e7b2dbefc838c93092e6be9d8ae8a2f8d2ebf /cocoa/ScintillaView.mm
parentd75ac05416e341c02195260d1106a17932a3032f (diff)
downloadscintilla-mirror-778dc10b3ee2f621d8548b1d074429c44bd3ae62.tar.gz
On macOS 10.13+, use new NSPasteboardTypeFileURL type to receive files dragged
onto Scintilla but continue using NSFilenamesPboardType on older systems.
Diffstat (limited to 'cocoa/ScintillaView.mm')
-rw-r--r--cocoa/ScintillaView.mm10
1 files changed, 9 insertions, 1 deletions
diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm
index 1ca7ab8e2..ad074b496 100644
--- a/cocoa/ScintillaView.mm
+++ b/cocoa/ScintillaView.mm
@@ -235,7 +235,15 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) {
trackingArea = nil;
mMarkedTextRange = NSMakeRange(NSNotFound, 0);
- [self registerForDraggedTypes: @[NSPasteboardTypeString, ScintillaRecPboardType, NSFilenamesPboardType]];
+ if (@available(macOS 10.13, *)) {
+ [self registerForDraggedTypes: @[NSPasteboardTypeString, ScintillaRecPboardType, NSPasteboardTypeFileURL]];
+ } else {
+ // Use old deprecated type
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ [self registerForDraggedTypes: @[NSPasteboardTypeString, ScintillaRecPboardType, NSFilenamesPboardType]];
+#pragma clang diagnostic pop
+ }
// Set up accessibility in the text role
if ([self respondsToSelector: @selector(setAccessibilityElement:)]) {