JDK-4711693 : Pop-up doesn't stay up
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.0_02,1.4.1
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_8,windows_2000
  • CPU: x86,sparc
  • Submitted: 2002-07-08
  • Updated: 2003-03-12
  • Resolved: 2002-10-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other Other Other Other
1.3.1_07 07Fixed 1.4.0_03Fixed 1.4.1_02Fixed 1.4.2Fixed
Related Reports
Duplicate :  
Description
Testcase :  Position the application window in the extreme bottom right of the
            desktop & bring up the pop-up menu using the right mouse button
            click.

Problem :  The pop-up menu just flashes with the right mouse click when released 
           & doesn't stay at the location so that users can select other menu
           items.  It seems the menu should pop up just above the mouse cursor,
           so when the button is released the menu list would stay up

Platform :    Sun Workstation (Ultra-60)
 Desktop : CDE 1.4.7,  X11 Version 6.4.1
      OS : SunOS 5.8
     JDK :  1.3.1_02

The testcase is included in the attachments

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.3.1_07 1.4.0_03 1.4.1_02 mantis tiger FIXED IN: 1.3.1_07 1.4.0_03 1.4.1_02 mantis tiger INTEGRATED IN: 1.3.1_07 1.4.0_03 1.4.1_02 mantis mantis-b12 tiger tiger-b03
24-08-2004

SUGGESTED FIX Name: azR10139 Date: 07/12/2002 ------- JMenuItem.java ------- *** /tmp/sccs.dEaary Fri Jul 12 19:56:35 2002 --- JMenuItem.java Fri Jul 12 19:28:23 2002 *************** *** 72,77 **** --- 72,79 ---- private static final boolean VERBOSE = false; // show reuse hits/misses private static final boolean DEBUG = false; // show bad params, misc. + private boolean isMouseDragged = false; + /** * Creates a <code>JMenuItem</code> with no set text or icon. */ *************** *** 470,482 **** public void processMenuDragMouseEvent(MenuDragMouseEvent e) { switch (e.getID()) { case MouseEvent.MOUSE_ENTERED: ! fireMenuDragMouseEntered(e); break; case MouseEvent.MOUSE_EXITED: ! fireMenuDragMouseExited(e); break; case MouseEvent.MOUSE_DRAGGED: ! fireMenuDragMouseDragged(e); break; case MouseEvent.MOUSE_RELEASED: ! fireMenuDragMouseReleased(e); break; default: break; } --- 472,484 ---- public void processMenuDragMouseEvent(MenuDragMouseEvent e) { switch (e.getID()) { case MouseEvent.MOUSE_ENTERED: ! isMouseDragged = false; fireMenuDragMouseEntered(e); break; case MouseEvent.MOUSE_EXITED: ! isMouseDragged = false; fireMenuDragMouseExited(e); break; case MouseEvent.MOUSE_DRAGGED: ! isMouseDragged = true; fireMenuDragMouseDragged(e); break; case MouseEvent.MOUSE_RELEASED: ! if(isMouseDragged) fireMenuDragMouseReleased(e); break; default: break; } ------- BasicMenuItemUI.java ------- *** /tmp/sccs.Mbaisy Fri Jul 12 19:57:59 2002 --- BasicMenuItemUI.java Fri Jul 12 19:39:45 2002 *************** *** 986,992 **** private class MenuDragMouseHandler implements MenuDragMouseListener { ! public void menuDragMouseEntered(MenuDragMouseEvent e) {} public void menuDragMouseDragged(MenuDragMouseEvent e) { MenuSelectionManager manager = e.getMenuSelectionManager(); MenuElement path[] = e.getPath(); --- 986,996 ---- private class MenuDragMouseHandler implements MenuDragMouseListener { ! public void menuDragMouseEntered(MenuDragMouseEvent e) { ! MenuSelectionManager manager = e.getMenuSelectionManager(); ! MenuElement path[] = e.getPath(); ! manager.setSelectedPath(path); ! } public void menuDragMouseDragged(MenuDragMouseEvent e) { MenuSelectionManager manager = e.getMenuSelectionManager(); MenuElement path[] = e.getPath(); ======================================================================
24-08-2004

EVALUATION Name: azR10139 Date: 07/12/2002 When user right-clicks near the right bottom of the desktop popup is appearing on the MOUSE_PRESSED event and, if it is partially out of the desktop borders popup is moved to be fully visible on the desktop. If after this move mouse cursor is stays over any menuitem, MenuSelectionManager will forward all the mouse events to the menuitem under mouse cursor until mouse button is pressed. This made to support MenuDragMouseEvent. The idea of suggested fix is to waive MOUSE_RELEASE events until at least one MOUSE_DRAGGED event hits menuitem. Also i changed BasicMenuItemUI$MenuDragMouseHandler.menuDragMouseEntered() method, so, in this situation menu stays with selected item, that lays under mouse cursor as it should be and not the first item of the popup which is incorrect (look bug 4706304 for details). ###@###.### 07/12/2002 ======================================================================
12-07-2002