src/solaris/classes/sun/awt/X11/XToolkit.java

Print this page

        

@@ -925,10 +925,15 @@
     public FontPeer getFontPeer(String name, int style){
         return new XFontPeer(name, style);
     }
 
     public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException {
+        final LightweightFrame f = SunToolkit.getLightweightFrame(dge.getComponent());
+        if (f != null) {
+            return f.createDragSourceContextPeer(dge);
+        }
+
         return XDragSourceContextPeer.createDragSourceContextPeer(dge);
     }
 
     @SuppressWarnings("unchecked")
     public <T extends DragGestureRecognizer> T

@@ -936,10 +941,15 @@
                     DragSource ds,
                     Component c,
                     int srcActions,
                     DragGestureListener dgl)
     {
+        final LightweightFrame f = SunToolkit.getLightweightFrame(c);
+        if (f != null) {
+            return f.createDragGestureRecognizer(recognizerClass, ds, c, srcActions, dgl);
+        }
+
         if (MouseDragGestureRecognizer.class.equals(recognizerClass))
             return (T)new XMouseDragGestureRecognizer(ds, c, srcActions, dgl);
         else
             return null;
     }