United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7177144 [macosx] Drag and drop not working (regression in 7u6)
JDK-7177144 : [macosx] Drag and drop not working (regression in 7u6)

Details
Type:
Bug
Submit Date:
2012-06-14
Status:
Closed
Updated Date:
2013-04-20
Project Name:
JDK
Resolved Date:
2012-08-03
Component:
client-libs
OS:
os_x
Sub-Component:
java.awt
CPU:
x86
Priority:
P1
Resolution:
Fixed
Affected Versions:
7u6
Fixed Versions:
7u6 (b22)

Related Reports
Backport:

Sub Tasks

Description
This is a regression in 7u6. The functionality works with 7u5.

Reported with NetBeans - Drag and drop doesn't work. You can't reorganize any tabs in window, either you can't move some selected code to another part or move classes between packages etc...

Evaluation on NetBeans side - The first attempt to drag anything (an internal window or a node in Projects/Files window) actually does start. But after a short time the dragging is interrupted for unknown reasons. The drag rectangle representing the dragged object is still being painted on the screen (on top of all windows). Furthermore, the system Dock becomes disabled and does not react to mouse events - it isn't possible to switch to other windows by clicking their Dock icons. Popup menu on the Dock doesn't work either. Switching to other apps with keyboard works fine though. After quitting the application in broken drag mode, the Dock becomes responsive again. When dragging is interrupted there's still a Thread stuck in DragSourceContextPeer.doDragging().

Not reproduced outside of NetBeans.

Note for JDK team - NetBeans implements its d'n'd support using java.awt.dnd classes, we don't use javax.swing.TransferHandler.

                                    

Comments
EVALUATION

As far as i see the problem sits with the org.netbeans.core.TimableEventQueue class. And the problem is that most events posted by SunDropTargetContextPeer.postDropTargetEvent get trough the event queue and being dispatched, but sometimes - mostly when mouse crosses the component border - event does not gets trough and when EventDispatchThread.pumpOneNventForFilters asks TimableEventQueue for the next event it doesn't get it and event is being stuck. And because drag'n'drop events are synchronous the post method doesn't exit until event is dispatched which is never. Hence the DnD operation stops. Looks like a problem in the NetBeans code. I'm making this CR incomplete giving NetBeans people have a say on it and if it stays incomplete for more than a week i'll go ahead and close it as working as designed.
                                     
2012-07-02
EVALUATION

This was just reproduced without TimableEventQueue, see thread dump in attachment.
reproduced with Java(TM) SE Runtime Environment 1.7.0_06-ea-b18
                                     
2012-07-10
EVALUATION

The main reason of this problem is that Drag and Drop events are being thrown away from the EventQueue by coalesceMouseEvent and proposed fix is not to put SunDropTargetEvent-derived objects into the queue used to coalesce events which prevents this type of events from disappearing.
                                     
2012-07-17



Hardware and Software, Engineered to Work Together