JDK-5048265 : Invoking modal dialog while DnD is in progress
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2004-05-17
  • Updated: 2011-05-13
Related Reports
Relates :  
Relates :  
Description
This bug occurs in XToolkit on Solaris and Linux in tiger-beta2. While a drag and drop is in progress, popup a modal dialog. If the mouse pointer is at the drop target when the modal dialog pops up, the drag and drop is not getting cancelled and the successive drag and drop attempts will throw the following exception:

java.awt.dnd.InvalidDnDOperationException: Drag and drop in progress
        at sun.awt.dnd.SunDragSourceContextPeer.setDragDropInProgress(SunDragSourceContextPeer.java:298)
        at java.awt.dnd.DragSource.startDrag(DragSource.java:286)
        at java.awt.dnd.DragSource.startDrag(DragSource.java:403)
        at java.awt.dnd.DragGestureEvent.startDrag(DragGestureEvent.java:221)
        at TestDragList$AWTDnDAdapter.dragGestureRecognized(TestDragList.java:99)
        at java.awt.dnd.DragGestureRecognizer.fireDragGestureRecognized(DragGestureRecognizer.java:339)
        at sun.awt.X11.XMouseDragGestureRecognizer.mouseDragged(XMouseDragGestureRecognizer.java:202)
        at java.awt.Component.processMouseMotionEvent(Component.java:5511)
        at java.awt.Component.processEvent(Component.java:5232)
        at java.awt.List.processEvent(List.java:1035)
        at java.awt.Component.dispatchEventImpl(Component.java:3931)
        at java.awt.Component.dispatchEvent(Component.java:3779)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

The bug can be reproduced as follows:

1. Run the attached code on XToolkit.
2. Click on the ClickMe button.
3. Drag from the first List and move the mouse to second List. Don't release the mouse button
4. A modal dialog pops up. Now release the mouse and close the modal dialog by clicking the Close butoon.
5. Try drag and drop between Lists and it can be seen that the exception results.

Comments
EVALUATION Name: agR10216 Date: 06/01/2004 Should cancel the ongoing DnD operation if a modal dialog pops up (in XAWT). ###@###.### 2004-06-01 ======================================================================
01-06-2004