From 9f24a90e2b89294d671ac922a2c59a7306401db9 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Fri, 2 Mar 2012 07:17:45 +0000 Subject: [PATCH] adding translation of NSDragOperationGeneric to wxDragCopy fixes #14059 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70770 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/cocoa/dnd.mm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/osx/cocoa/dnd.mm b/src/osx/cocoa/dnd.mm index c697420bd8..2c26500ebe 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: @@ -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; } -- 2.45.2