7161109: [macosx] JCK AWT interactive test DnDTextDropTest fails on MacOS
Reviewed-by: serb
This commit is contained in:
parent
5df1b2e7f4
commit
b86618edf9
@ -985,7 +985,13 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent>
|
||||
// DropTargetPeer Method
|
||||
@Override
|
||||
public void addDropTarget(DropTarget dt) {
|
||||
synchronized (dropTargetLock){
|
||||
LWWindowPeer winPeer = getWindowPeerOrSelf();
|
||||
if (winPeer != null && winPeer != this) {
|
||||
// We need to register the DropTarget in the
|
||||
// peer of the window ancestor of the component
|
||||
winPeer.addDropTarget(dt);
|
||||
} else {
|
||||
synchronized (dropTargetLock) {
|
||||
// 10-14-02 VL: Windows WComponentPeer would add (or remove) the drop target only
|
||||
// if it's the first (or last) one for the component. Otherwise this call is a no-op.
|
||||
if (++fNumDropTargets == 1) {
|
||||
@ -998,10 +1004,17 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DropTargetPeer Method
|
||||
@Override
|
||||
public void removeDropTarget(DropTarget dt) {
|
||||
LWWindowPeer winPeer = getWindowPeerOrSelf();
|
||||
if (winPeer != null && winPeer != this) {
|
||||
// We need to unregister the DropTarget in the
|
||||
// peer of the window ancestor of the component
|
||||
winPeer.removeDropTarget(dt);
|
||||
} else {
|
||||
synchronized (dropTargetLock){
|
||||
// 10-14-02 VL: Windows WComponentPeer would add (or remove) the drop target only
|
||||
// if it's the first (or last) one for the component. Otherwise this call is a no-op.
|
||||
@ -1016,6 +1029,7 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---- PEER NOTIFICATIONS ---- //
|
||||
|
||||
|
@ -648,6 +648,10 @@ extern JNFClassInfo jc_CDropTargetContextPeer;
|
||||
if (sDraggingError == FALSE) {
|
||||
sDraggingLocation = [sender draggingLocation];
|
||||
NSPoint javaLocation = [fView convertPoint:sDraggingLocation fromView:nil];
|
||||
// The y coordinate that comes in the NSDraggingInfo seems to be reversed - probably
|
||||
// has to do something with the type of view it comes to.
|
||||
// This is the earliest place where we can correct it.
|
||||
javaLocation.y = fView.window.frame.size.height - javaLocation.y;
|
||||
|
||||
jint actions = [DnDUtilities mapNSDragOperationMaskToJava:[sender draggingSourceOperationMask]];
|
||||
jint dropAction = sJavaDropOperation;
|
||||
|
Loading…
x
Reference in New Issue
Block a user