JDK-4410070 : Choice can not be Dragged without CTRL Key in Linux.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: generic
  • CPU: generic
  • Submitted: 2001-01-31
  • Updated: 2004-04-26
  • Resolved: 2004-02-27
Related Reports
Relates :  
Relates :  
Description
Dragging Choice in Linux does not hapen without CRTL Key.


How to reproduce the Bug? -------->
	Complime all the java files.Run "DnDSample".
	You would see two frame-source and target.
	Try Dragging the choice from the source and drop it in target.
	Choice does not get dragged without pressing CRTL key.

Comments
EVALUATION This behavior has not changed since kestrel or ladybird. I'm not sure that this is a bug. It could be a desirable, window-manager specific behavior. For now, I am keeping this bug open with a lower priority so that we can investigate it further later. david.mendenhall@east 2001-01-31 Name: agR10216 Date: 10/16/2002 I have reproduced this bug with JDK 1.3.1 on Solaris and Linux, but as from JDK 1.4 (see 4288285) Choice can be dragged if drag initiates on the selected item of Choice, but not on the push-down arrow. It's because an superfluous MOUSE_ENTERED event is generated on Choice if mouse drag is initiated on the push-down arrow, and MMouseDragGestureRecognizer clears its list of events and then does not initiate a DnD operation. Let us consider delivered events with the following test case using the build 1.4.2-beta-b02. ------------------------------------------------------------------- import java.awt.*; import java.awt.event.*; public class ChoiceMouseEventTest { public static void main(String[] args) { Choice choice = new Choice(); choice.addItem("Item 1"); choice.addItem("Item 2"); choice.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { System.err.println(e); } public void mouseReleased(MouseEvent e) { System.err.println(e); } public void mouseEntered(MouseEvent e) { System.err.println(e); } public void mouseExited(MouseEvent e) { System.err.println(e); } }); choice.addMouseMotionListener(new MouseMotionAdapter() { public void mouseDragged(MouseEvent e) { System.err.println(e); } }); Frame frame = new Frame("ChoiceMouseEventTest"); frame.setLayout(new FlowLayout()); frame.add(choice); frame.setSize(200, 200); WindowListener wl = new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }; frame.addWindowListener(wl); frame.setVisible(true); } } ------------------------------------------------------------------- If the mouse is entered push-down button, then the mouse button is pressed, the mouse is dragged and the mouse button is released not on the choice, the delivered events are like these: java.awt.event.MouseEvent[MOUSE_ENTERED,(85,13),button=0,clickCount=0] on choice0 java.awt.event.MouseEvent[MOUSE_PRESSED,(82,17),button=1,modifiers=Button1,extModifiers=Button1,clickCount=1] on choice0 java.awt.event.MouseEvent[MOUSE_ENTERED,(143,46),button=0,modifiers=Button1,extModifiers=Button1,clickCount=0] on choice0 java.awt.event.MouseEvent[MOUSE_DRAGGED,(144,46),button=0,modifiers=Button1,extModifiers=Button1,clickCount=0] on choice0 java.awt.event.MouseEvent[MOUSE_DRAGGED,(144,46),button=0,modifiers=Button1,extModifiers=Button1,clickCount=0] on choice0 java.awt.event.MouseEvent[MOUSE_RELEASED,(144,46),button=1,modifiers=Button1,clickCount=0] on choice0 MOUSE_ENTERED event after MOUSE_PRESSED is the cause of this bug. If the mouse is entered push-down button, then the mouse button is pressed, the mouse is dragged to the selected item without exiting the boundaries of the choice and the mouse button is released on the selected item, the delivered events are like these: java.awt.event.MouseEvent[MOUSE_ENTERED,(85,25),button=0,clickCount=0] on choice0 java.awt.event.MouseEvent[MOUSE_PRESSED,(79,20),button=1,modifiers=Button1,extModifiers=Button1,clickCount=1] on choice0 java.awt.event.MouseEvent[MOUSE_ENTERED,(66,10),button=0,modifiers=Button1,extModifiers=Button1,clickCount=0] on choice0 java.awt.event.MouseEvent[MOUSE_DRAGGED,(68,14),button=0,modifiers=Button1,extModifiers=Button1,clickCount=0] on choice0 java.awt.event.MouseEvent[MOUSE_DRAGGED,(67,14),button=0,modifiers=Button1,extModifiers=Button1,clickCount=0] on choice0 java.awt.event.MouseEvent[MOUSE_DRAGGED,(66,14),button=0,modifiers=Button1,extModifiers=Button1,clickCount=0] on choice0 java.awt.event.MouseEvent[MOUSE_DRAGGED,(66,14),button=0,modifiers=Button1,extModifiers=Button1,clickCount=0] on choice0 java.awt.event.MouseEvent[MOUSE_RELEASED,(66,14),button=1,modifiers=Button1,clickCount=0] on choice0 java.awt.event.MouseEvent[MOUSE_RELEASED,(66,14),button=1,modifiers=Button1,clickCount=0] on choice0 MOUSE_ENTERED event after MOUSE_PRESSED is the cause of this bug. Note also 2 MOUSE_RELEASED events. In case that the mouse entered the selected item of a choice: java.awt.event.MouseEvent[MOUSE_ENTERED,(25,30),button=0,clickCount=0] on choice0 java.awt.event.MouseEvent[MOUSE_EXITED,(25,27),button=0,clickCount=0] on choice0 and then exited it: java.awt.event.MouseEvent[MOUSE_ENTERED,(25,30),button=0,clickCount=0] on choice0 java.awt.event.MouseEvent[MOUSE_EXITED,(25,33),button=0,clickCount=0] on choice0 If the mouse is on the selected item of a choice and the mouse is moved to the push-down arrow without exiting the boundaries of the choice: java.awt.event.MouseEvent[MOUSE_ENTERED,(70,16),button=0,clickCount=0] on choice0 If the mouse is on the push-down arrow of a choice and the mouse is moved to the selected item without exiting the boundaries of the choice: java.awt.event.MouseEvent[MOUSE_EXITED,(69,18),button=0,clickCount=0] on choice0 Reassigning to classes_awt for investigation. ###@###.### 2002-10-16 ====================================================================== Name: ssR10077 Date: 02/27/2004 Not reproducible with XAWT on JDK.1.5.0. Will not fix for MToolkit ======================================================================
17-09-2004