From 90bfddef2dc27b4176386ae3ce89d6af1fdc0ec4 Mon Sep 17 00:00:00 2001 From: Igor Ivanov Date: Sun, 25 Oct 2020 13:19:22 +0300 Subject: [PATCH] wxWidgetCocoaImpl::SetDropTarget fix. (#2102) --- src/osx/cocoa/window.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index 7f26b8585e..467998f485 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -3225,7 +3225,11 @@ void wxWidgetCocoaImpl::SetDropTarget(wxDropTarget* target) if (dobj) { wxCFMutableArrayRef typesarray; - dobj->AddSupportedTypes(typesarray, wxDataObjectBase::Direction::Get); + /* + In macOS the view controls the types we can drop onto it, so we have to collect + all formats that can be put into dataObject instead of only ones that can be get. + */ + dobj->AddSupportedTypes(typesarray, wxDataObjectBase::Direction::Set); NSView* targetView = m_osxView; if ([m_osxView isKindOfClass:[NSScrollView class]]) targetView = [(NSScrollView*)m_osxView documentView];