]> git.saurik.com Git - wxWidgets.git/commitdiff
adding translation of NSDragOperationGeneric to wxDragCopy fixes #14059
authorStefan Csomor <csomor@advancedconcepts.ch>
Fri, 2 Mar 2012 07:17:45 +0000 (07:17 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Fri, 2 Mar 2012 07:17:45 +0000 (07:17 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70770 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/dnd.mm

index c697420bd81d6c0c113a273605de146fb07d98b9..2c26500ebef9b3f3877a8301b5ac6dc09df9b624 100644 (file)
@@ -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;
     }