JDK-4919214 : XAWT Choice does not post on popup after a slight motion before button release.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: solaris_8
  • CPU: sparc
  • Submitted: 2003-09-08
  • Updated: 2011-05-25
Related Reports
Relates :  
Relates :  
Description
The XAWT Choice does a popdown unexpectedly when it is popped up 
and the mouse is moved even slightly before the button release.
It should post (stay up) after the button release on the Choice button, 
even if there is a slight motion event while the button is down, unless 
the button release occurs in the menu, in which case it should popdown. 

Comments
EVALUATION Should be fixed. ###@###.### 2003-09-17 Name: adR10249 Date: 10/10/2003 This bug was fixed with 4922472. Now the Choice is not popdown after mouse is slightly moved and released. ###@###.### 10-Oct-2003 ====================================================================== After this fix XAWT became incompatible with Motif. In the same situation Motifs' Choice becomes closed. ###@###.### 2005-03-18 09:06:17 GMT
18-03-2005

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-beta FIXED IN: tiger-beta INTEGRATED IN: tiger-b28 tiger-beta
24-08-2004

SUGGESTED FIX Name: adR10249 Date: 10/20/2003 *** /tmp/geta23730 ?L ?TL 9 19:17:46 2003 --- XChoicePeer.java ?L ?TL 9 19:12:28 2003 *************** *** 66,79 **** // dragged over the (unfurled) // Choice - private boolean unfurledRelease = false; // Mouse was pressed and released - // without being dragged, meaning - // the Choice should remain - // unfurled. - private boolean mouseInSB = false; // Mouse is interacting with the // scrollbar private ListHelper helper; private UnfurledChoice unfurledChoice; --- 66,78 ---- // dragged over the (unfurled) // Choice private boolean mouseInSB = false; // Mouse is interacting with the // scrollbar + private boolean firstPress = false; // mouse was pressed on + // furled Choice so we + // not need to furl the + // Choice when MOUSE_RELEASED occured private ListHelper helper; private UnfurledChoice unfurledChoice; *************** *** 152,160 **** // MOUSE_ENTERED & MOUSE_EXITED are still sent case MouseEvent.MOUSE_CLICKED: case MouseEvent.MOUSE_PRESSED: - case MouseEvent.MOUSE_RELEASED: handleJavaMouseEvent((MouseEvent)event); break; case MouseEvent.MOUSE_WHEEL: handleJavaMouseWheelEvent((MouseWheelEvent)event); break; --- 151,166 ---- // MOUSE_ENTERED & MOUSE_EXITED are still sent case MouseEvent.MOUSE_CLICKED: case MouseEvent.MOUSE_PRESSED: handleJavaMouseEvent((MouseEvent)event); break; + case MouseEvent.MOUSE_RELEASED: + if ( unfurledChoice.isMouseEventInside( (MouseEvent)event )){ + handleJavaMouseEvent((MouseEvent)event); + } + else { + super.postEvent(event); + } + break; case MouseEvent.MOUSE_WHEEL: handleJavaMouseWheelEvent((MouseWheelEvent)event); break; *************** *** 269,275 **** case KeyEvent.VK_ENTER: if (unfurled) { unfurled = false; - unfurledRelease = false; dragging = false; mouseInSB = false; ungrabInput(); --- 275,280 ---- *************** *** 321,326 **** --- 326,332 ---- // Choice is up - unfurl it grabInput(); unfurledChoice.toFront(); + firstPress = true; unfurled = true; } } *************** *** 330,347 **** if (mouseInSB) { unfurledChoice.trackMouse(e); } ! else if (dragging || unfurledRelease) { // We pressed and dragged onto the Choice, or, this is the // second release after clicking to make the Choice "stick" // unfurled. // This release should ungrab/furl, and set the new item if // release was over the unfurled Choice. ! ! ungrabInput(); ! unfurledChoice.setVisible(false); ! unfurled = false; ! unfurledRelease = false; ! if (!helper.isEmpty()) { // Only update the Choice if the mouse button is released // over the list of items. --- 336,353 ---- if (mouseInSB) { unfurledChoice.trackMouse(e); } ! else { // We pressed and dragged onto the Choice, or, this is the // second release after clicking to make the Choice "stick" // unfurled. // This release should ungrab/furl, and set the new item if // release was over the unfurled Choice. ! if ( !firstPress || unfurledChoice.isMouseEventInside( e ) ) { ! ungrabInput(); ! unfurledChoice.setVisible(false); ! unfurled = false; ! } ! if (!helper.isEmpty()) { // Only update the Choice if the mouse button is released // over the list of items. *************** *** 367,378 **** } } } - else { - // This was a release without a drag - Choice stays unfurled - unfurledRelease = true; - } } dragging = false; dragStartIdx = -1; } --- 373,381 ---- } } } } dragging = false; + firstPress = false; dragStartIdx = -1; } ###@###.### 20-Oct-2003 ======================================================================
24-08-2004