JDK-4989414 : dragExit event not properly triggered
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: generic
  • CPU: generic
  • Submitted: 2004-02-05
  • Updated: 2004-04-27
  • Resolved: 2004-04-27
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
DragSourceListener.dragExit() method is not invoked when the mouse dragging is done quickly. ie while dragging, the mouse must be present in the drop site for quite some time for the method to be invoked. Works fine in jdk-1.4.2

How to reproduce:
1. Run the attached code
2. Drag an element from the first JList to the second. Drag the element from a position close to the right end without placing the mouse on the first JList for a long time.
3. The events triggered are printed on the terminal window. It can be seen that the dragExit method is not invoked. Also the dragExit method is implemented to remove the dragged element from the first JList.
4. Drag an element slowly and it can be seen that the dragExit method is getting invoked and as a result, the element getting removed from the JList

The behavior occurs from Tiger b13 onwards. I have tested it on Solaris 9 and Windows 2000. Please see the log file attached to the output log of the testcase. The log file shows two drag and drop actions. First one, when DragExit is not getting called (Events 1-29) and second one when it is getting called (Events 30-105).

Comments
WORK AROUND
24-08-2004

PUBLIC COMMENTS
24-08-2004

EVALUATION This application uses pure AWT DnD. Re-assigning. ###@###.### 2004-03-18 Name: agR10216 Date: 03/19/2004 Could the submitter please specify platforms and builds on which he observes the problem and list outputs of the attached test produced on his successful and unsuccessful DnD operations? ###@###.### 2004-03-19 ====================================================================== Name: agR10216 Date: 04/27/2004 (1) Both lists are drag sources and drop targets simultaneously. If drag is started on one list, the drag gesture is recognized, and DragSourceListener.dragEnter() on this list's listener is called before the mouse pointer leaves the list, then DragSourceListener.dragExit() is called in accordance with the javadoc for this method. (2) After a drag from a position close to the right end of the left list, MOUSE_DRAGGED events on the list are generated synthetically. For details see the bug 4449146 (mouseDragged event still fired while drag and drop). So in a subsequent drag the drag gesture is recognized even if the mouse isn't moved! And DragSourceListener.dragExit() is called as it's explained in (1). (3) In mantis, DragSourceListener.dragExit() is called just before dragDropEnd(), but tiger fixes 4819437 (DragSourceListener.dragExit() is called unexpectedly) and 4874092 (dragEnter/dragExit methods of DragSourceListener fire without reaching target) enforced current behavior (refer to the javadoc for DragSourceListener.dragExit()). ------------------------- NOTES TO SQE ENGINEERS ----------------------------- (4) The dragged list element should not be removed in DragSourceListener.dragExit() since an invocation of this method doesn't imply a drop (refer to the javadoc), the dragged element should be removed in DragSourceListener.dragDropEnd(DragSourceDropEvent dsde) only if dsde.getDropAction() is DnDConstants.ACTION_MOVE. (5) THE MOST IMPORTANT NOTE: This is the fourth (at least) bug that was closed as 'not a bug' or 'will not fix', others are: 4449146 (mouseDragged event still fired while drag and drop), 4380088 (Cannot drag and drop multiple items), 4950103 (InvalidDnDOperationException when Dragging/Dropping in the same JTable). All these bugs complain about issues originated from usage of direct AWT DnD support with Swing components. Such usage is discouraged. So DnD team requests NOT TO USE DIRECT AWT DND SUPPORT WITH ANY SWING COMPONENTS. It's sufficient to use only AWT components for testing AWT DnD functionality. ------------------- END OF NOTES TO SQE ENGINEERS ---------------------------- ###@###.### 2004-04-26 ======================================================================
26-04-2004