OpenJDK / bsd-port / bsd-port / jdk
changeset 4915:4c06f31fd3a2
7124399: [macosx] All Swing drag-n-drop tests faild
Reviewed-by: alexp
author | kizune |
---|---|
date | Tue, 31 Jan 2012 17:15:30 +0300 |
parents | 58c548d6b53e |
children | 42a19b1e0a7b |
files | src/macosx/classes/sun/lwawt/macosx/CDropTargetContextPeer.java src/macosx/native/sun/awt/CDropTarget.m |
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 09:19:02 2012 +0000 +++ b/src/macosx/classes/sun/lwawt/macosx/CDropTargetContextPeer.java Tue Jan 31 17:15:30 2012 +0300 @@ -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 09:19:02 2012 +0000 +++ b/src/macosx/native/sun/awt/CDropTarget.m Tue Jan 31 17:15:30 2012 +0300 @@ -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;