--- old/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java 2013-01-24 19:25:37.000000000 +0400 +++ new/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java 2013-01-24 19:25:37.000000000 +0400 @@ -98,28 +98,16 @@ Point componentOffset = new Point(); ComponentPeer peer = component.getPeer(); - // For a lightweight component traverse up the hierarchy to the first heavyweight - // which will be used as the ComponentModel for the native drag source. - if (component.isLightweight()) { - Point loc = component.getLocation(); - componentOffset.translate(loc.x, loc.y); - - for (Component parent = component.getParent(); parent != null; parent = parent.getParent()) { - if (parent.isLightweight() == false) { - peer = parent.getPeer(); - break; - } - loc = parent.getLocation(); - componentOffset.translate(loc.x, loc.y); - } + // For a component traverse up the hierarchy to the root + Point loc = new Point(); + for (Component loopComponent = component; loopComponent != null; loopComponent = loopComponent.getParent()) { + peer = loopComponent.getPeer(); + componentOffset.translate(loc.x, loc.y); + loc = loopComponent.getLocation(); } - // Make sure the drop target is a ComponentModel: - if (!(peer instanceof LWComponentPeer)) - throw new IllegalArgumentException("DragSource's peer must be a ComponentModel."); - - // Get model pointer (CButton.m and such) and its native peer: + //Get a pointer to a native window LWComponentPeer model = (LWComponentPeer) peer; CPlatformWindow platformWindow = (CPlatformWindow) model.getPlatformWindow(); long nativeWindowPtr = platformWindow.getNSWindowPtr();