7177144: [macosx] Drag and drop not working (regression in 7u6)
authorkizune
Mon, 13 Aug 2012 19:49:04 +0400
changeset 13541 5626307c2f86
parent 13540 7db2a9741c48
child 13542 93873f8b6528
7177144: [macosx] Drag and drop not working (regression in 7u6) Reviewed-by: art, serb
jdk/src/share/classes/java/awt/EventQueue.java
--- a/jdk/src/share/classes/java/awt/EventQueue.java	Mon Aug 13 19:19:34 2012 +0400
+++ b/jdk/src/share/classes/java/awt/EventQueue.java	Mon Aug 13 19:49:04 2012 +0400
@@ -36,6 +36,8 @@
 import java.security.PrivilegedAction;
 
 import java.util.EmptyStackException;
+
+import sun.awt.dnd.SunDropTargetEvent;
 import sun.util.logging.PlatformLogger;
 
 import sun.awt.AppContext;
@@ -464,7 +466,9 @@
         case MouseEvent.MOUSE_MOVED:
             return MOVE;
         case MouseEvent.MOUSE_DRAGGED:
-            return DRAG;
+            // Return -1 for SunDropTargetEvent since they are usually synchronous
+            // and we don't want to skip them by coalescing with MouseEvent or other drag events
+            return e instanceof SunDropTargetEvent ? -1 : DRAG;
         default:
             return e instanceof PeerEvent ? PEER : -1;
         }