changeset 4917:42a19b1e0a7b

Merge
author michaelm
date Tue, 31 Jan 2012 14:26:41 +0000
parents afcc933a944e 4c06f31fd3a2
children 611d9bf5b908
files
diffstat 2 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/macosx/classes/sun/lwawt/macosx/CDropTargetContextPeer.java	Tue Jan 31 14:26:04 2012 +0000
+++ b/src/macosx/classes/sun/lwawt/macosx/CDropTargetContextPeer.java	Tue Jan 31 14:26:41 2012 +0000
@@ -93,9 +93,8 @@
     @Override
     protected void processMotionMessage(SunDropTargetEvent event, boolean operationChanged) {
         Component eventSource = (Component)event.getComponent();
-        Component rootComponent = SwingUtilities.getRoot(eventSource);
         Point screenPoint = event.getPoint();
-        SwingUtilities.convertPointToScreen(screenPoint, rootComponent);
+        SwingUtilities.convertPointToScreen(screenPoint, eventSource);
         Rectangle screenBounds = new Rectangle(eventSource.getLocationOnScreen().x,
                 eventSource.getLocationOnScreen().y,
                 eventSource.getWidth(), eventSource.getHeight());
@@ -105,21 +104,26 @@
                 insideTarget = false;
                 return;
             }
-            super.processMotionMessage(event, operationChanged);
+        } else {
+            if(screenBounds.contains(screenPoint)) {
+                processEnterMessage(event);
+                insideTarget = true;
+            } else {
+                return;
+            }
         }
-        insideTarget = screenBounds.contains(screenPoint);
+        super.processMotionMessage(event, operationChanged);
     }
 
     @Override
     protected void processDropMessage(SunDropTargetEvent event) {
         Component eventSource = (Component)event.getComponent();
-        Component rootComponent = SwingUtilities.getRoot(eventSource);
         Point screenPoint = event.getPoint();
-        SwingUtilities.convertPointToScreen(screenPoint, rootComponent);
+        SwingUtilities.convertPointToScreen(screenPoint, eventSource);
         Rectangle screenBounds = new Rectangle(eventSource.getLocationOnScreen().x,
                 eventSource.getLocationOnScreen().y,
                 eventSource.getWidth(), eventSource.getHeight());
-        if(!screenBounds.contains(screenPoint)) {
+        if(screenBounds.contains(screenPoint)) {
             super.processDropMessage(event);
         }
     }
--- a/src/macosx/native/sun/awt/CDropTarget.m	Tue Jan 31 14:26:04 2012 +0000
+++ b/src/macosx/native/sun/awt/CDropTarget.m	Tue Jan 31 14:26:41 2012 +0000
@@ -571,7 +571,7 @@
     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.frame.size.height - javaLocation.y;
+		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;