JDK-5101912 : MouseDrag events are not delivered to the component when they are non-focusable
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-09-14
  • Updated: 2010-08-04
Related Reports
Relates :  
Description
Setting focusability to false for any component prevents it from receiving MouseDragged events when the mouse goes out of the component. According to the specification, MouseDragged events must be delivered to the component regardless of where the mouse pointer is, as long as the mouse button is down. This does not say anything about the component focusability. This works as expected when the component is focusable.

This is reproducible only on win32 platforms right from JDK1.4. This is not reproducible on Solaris / Linux. 

I have attached a sample test. You would see 4 checkboxes and a button. The button and the first checkbox are non-focusable. Click one of them and drag the mouse out of the frame. If the mouse dragged events stops triggering after mouse comes out of the component, the bug is reproduced. 

Comments
EVALUATION Double click just before dragging the mouse pointer out of the unfocusable component makes AWT to generate DraggedEvents for the area outside original component but not out of the Window. I tracked down the difference in two scenarios (focusable and unfocusable components) till the awt_Object.GetPeer() return value. When the mouse pointer leaves the unfocusable component and we are about to send mouse event (DragEvent) that method returns other value then before. In the case of focusable component the same value is still returned. Then, leaving the toplevel stops sending any mouse events to unfocusable component on AwtComponent::WindowProc() function level.
22-02-2008

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
17-09-2004

EVALUATION Name: ad153231 Date: 09/15/2004 reproducible on Windows only since JDK1.4. ====================================================================== Name: ad153231 Date: 09/15/2004 This is a possible regression of 4452384. Reg-test at java/awt/Focus/NonFocusableWindows/Test.java would be useful. ====================================================================== Affects all the Components. Not really sure why AWT behaves in such a way. Should be fixed on mustang. ###@###.### 2004-09-16
16-09-2004