X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d6eb3ff8a1a25e54aa9269ff3da25969f9681ae0..ab67e8874db324fab5223cc8d5dff8a8de3e2b77:/src/osx/cocoa/dnd.mm diff --git a/src/osx/cocoa/dnd.mm b/src/osx/cocoa/dnd.mm index c697420bd8..c12e16f5b9 100644 --- a/src/osx/cocoa/dnd.mm +++ b/src/osx/cocoa/dnd.mm @@ -36,6 +36,8 @@ wxDragResult NSDragOperationToWxDragResult(NSDragOperation code) { switch (code) { + case NSDragOperationGeneric: + return wxDragCopy; case NSDragOperationCopy: return wxDragCopy; case NSDragOperationMove: @@ -218,7 +220,7 @@ wxDragResult wxDropSource::DoDragDrop(int WXUNUSED(flags)) wxASSERT_MSG(theEvent, "DoDragDrop must be called in response to a mouse down or drag event."); NSPoint down = [theEvent locationInWindow]; - NSPoint p = [view convertPoint:down toView:nil]; + NSPoint p = [view convertPoint:down fromView:nil]; gCurrentSource = this; @@ -250,6 +252,23 @@ wxDragResult wxDropSource::DoDragDrop(int WXUNUSED(flags)) result = NSDragOperationToWxDragResult([delegate code]); [delegate release]; [image release]; + + wxWindow* mouseUpTarget = wxWindow::GetCapture(); + + if ( mouseUpTarget == NULL ) + { + mouseUpTarget = m_window; + } + + if ( mouseUpTarget != NULL ) + { + wxMouseEvent wxevent(wxEVT_LEFT_DOWN); + ((wxWidgetCocoaImpl*)mouseUpTarget->GetPeer())->SetupMouseEvent(wxevent , theEvent) ; + wxevent.SetEventType(wxEVT_LEFT_UP); + + mouseUpTarget->HandleWindowEvent(wxevent); + } + gCurrentSource = NULL; }