Drag and drop fix

Daniel Zatonyi <[email protected]> Tue, 05 May 2015 11:09:17 +0200
Newsgroups gmane.comp.java.ikvm.devel
Message-ID <[email protected]>
Hello,

In this patch I convert the screen coordinates to relative coordinates 
in the drop target event when dropping on a java.awt.Component.
I faced the issue in our application which supports a drag and drop 
operation between two of its Components.

Best regards,
Daniel

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y

_______________________________________________
Ikvm-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ikvm-developers
dragdrop.patch (text/plain, 940 B)
Index: toolkit-0.95.cs
===================================================================
RCS file: /cvsroot/ikvm/ikvm/awt/toolkit-0.95.cs,v
retrieving revision 1.112
diff -u -r1.112 toolkit-0.95.cs
--- toolkit-0.95.cs	16 Apr 2015 14:02:10 -0000	1.112
+++ toolkit-0.95.cs	5 May 2015 08:49:08 -0000
@@ -1414,7 +1414,11 @@
                                       int eventID,
                                       bool dispatchType)
         {
-            return base.postDropTargetEvent(component, x, y,
+		    NetComponentPeer peer = (NetComponentPeer)component.getPeer();
+            Control control = peer.Control;
+			Point screenPt = new Point(x, y);
+            Point clientPt = control.PointToClient(screenPt);
+            return base.postDropTargetEvent(component, clientPt.X, clientPt.Y,
                                      dropAction, actions, formats, nativeCtxt, eventID, dispatchType);
         }