src/macosx/native/sun/awt/CDropTarget.m

Print this page

        

@@ -475,10 +475,12 @@
 
     if (sDraggingError == FALSE) {
         sDraggingExited = FALSE;
         sDraggingLocation = [sender draggingLocation];
         NSPoint javaLocation = [fView convertPoint:sDraggingLocation fromView:nil];
+        javaLocation.y = fView.window.frame.size.height - javaLocation.y;
+
         DLog5(@"+ dragEnter: loc native %f, %f, java %f, %f\n", sDraggingLocation.x, sDraggingLocation.y, javaLocation.x, javaLocation.y);
 
                 ////////// BEGIN Calculate the current drag actions //////////
                 jint actions = java_awt_dnd_DnDConstants_ACTION_NONE;
         jint dropAction = actions;

@@ -568,11 +570,10 @@
     jint userAction = dropAction;
 
     // Should we notify Java things have changed?
     if (sDraggingError == FALSE && notifyJava) {
         NSPoint javaLocation = [fView convertPoint:sDraggingLocation fromView:nil];
-                // For some reason even after the convertPoint drag events come with the y coordinate reverted
                 javaLocation.y = fView.window.frame.size.height - javaLocation.y;
         //DLog5(@"  : dragMoved: loc native %f, %f, java %f, %f\n", sDraggingLocation.x, sDraggingLocation.y, javaLocation.x, javaLocation.y);
 
         jlongArray formats = sDraggingFormats;