< prev index next >

src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java

Print this page
rev 58521 : 7185258: [macosx] Deadlock in SunToolKit.realSync()
Reviewed-by: XXX

@@ -105,10 +105,11 @@
 import sun.awt.CGraphicsDevice;
 import sun.awt.LightweightFrame;
 import sun.awt.PlatformGraphicsInfo;
 import sun.awt.SunToolkit;
 import sun.awt.datatransfer.DataTransferer;
+import sun.awt.dnd.SunDragSourceContextPeer;
 import sun.awt.util.ThreadGroupUtils;
 import sun.java2d.opengl.OGLRenderQueue;
 import sun.lwawt.LWComponentPeer;
 import sun.lwawt.LWCursorManager;
 import sun.lwawt.LWToolkit;

@@ -461,10 +462,15 @@
         desktopProperties.put("DnD.Cursor.LinkNoDrop", new NamedCursor("DnD.Cursor.LinkNoDrop"));
     }
 
     @Override
     protected boolean syncNativeQueue(long timeout) {
+        if (SunDragSourceContextPeer.isDragDropInProgress()) {
+            // The java code started the DnD, but the native drag may still not
+            // start, the last attempt to flush the native events
+            timeout = 50;
+        }
         return nativeSyncQueue(timeout);
     }
 
     @Override
     public native void beep();
< prev index next >