src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java

Print this page

        

@@ -96,18 +96,19 @@
         // Get drag source component and its peer:
         Component component = trigger.getComponent();
         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()) {
+        if (!(component instanceof Window)) {
             Point loc = component.getLocation();
             componentOffset.translate(loc.x, loc.y);
 
             for (Component parent = component.getParent(); parent != null; parent = parent.getParent()) {
-                if (parent.isLightweight() == false) {
+                if (parent instanceof Window) {
                     peer = parent.getPeer();
                     break;
                 }
 
                 loc = parent.getLocation();