wxWidgetCocoaImpl::SetDropTarget fix. (#2102)

This commit is contained in:
Igor Ivanov
2020-10-25 13:19:22 +03:00
committed by GitHub
parent 0a70d3241d
commit 90bfddef2d

View File

@@ -3225,7 +3225,11 @@ void wxWidgetCocoaImpl::SetDropTarget(wxDropTarget* target)
if (dobj)
{
wxCFMutableArrayRef<CFStringRef> 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];