diff options
author | Neil Hodgson <nyamatongwe@gmail.com> | 2023-02-24 10:25:54 +1100 |
---|---|---|
committer | Neil Hodgson <nyamatongwe@gmail.com> | 2023-02-24 10:25:54 +1100 |
commit | 778dc10b3ee2f621d8548b1d074429c44bd3ae62 (patch) | |
tree | 9f7e7b2dbefc838c93092e6be9d8ae8a2f8d2ebf /cocoa/ScintillaView.mm | |
parent | d75ac05416e341c02195260d1106a17932a3032f (diff) | |
download | scintilla-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.mm | 10 |
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:)]) { |