JDK-6181157 : PIT: Default cursor is shown but changing when ALT key is down, on win32
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.2.2
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-10-19
  • Updated: 2006-10-04
  • Resolved: 2005-11-26
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 JDK 6
1.4.2_11Fixed 6 b62Fixed
Related Reports
Relates :  
Relates :  
Description
The following bug fix:
5097531: Mouse Cursor should be the default cursor when ALT key is pressed, on win32
is supposed to show the default cursor always when ALT key is pressed once. The cursor should change to the component specific cursor only when ALT is pressed again or when something is clicked.

But this bug fix has not considered the case of having an AWT menu added to the frame. It fixes the problem for the no-awt-menu case. The scenario is as follows:

I am having a frame with a button and a menu. 

1. Setting an image cursor for the frame containing a button.
2. setting wait cursor for the button.
3. pressing ALT. Chrsor changes to default cursor.
4. I am taking the mouse out of the frame and bringing it back.
5. Now I see Image cursor all over the frame, even on button.

This is incorrect. The cursor should always be the default cursor until I click something or press 'ALT' again.

This is noticed on Win_XP, since 1.2.2.

I have attached a test. Run the test. You would see a frame with a button. Move the mouse inside the frame. you should see an image cursor. Press & release the 'ALT' key. The cursor will change to def cursor. Take the mouse out of frame and bring it back. If you see the image cursor, the bug is reproduced.
###@###.### 10/19/04 13:10 GMT

Comments
SUGGESTED FIX http://sa.sfbay.sun.com/projects/awt_data/mustang/6181157/ *** (#1 of 1): [ UNSAVED ] ###@###.###
2005-11-02

EVALUATION On windows, whenever a menu is activated, WM_ENTERMENULOOP message is passed to the app window indicating that a menu modal loop has been entered. Similarly WM_EXITMENULOOP message is sent when the menu modal loop is exited. The fix would be to update the cursor to component cursor only if there's no menu modal loop active.
2005-10-17

EVALUATION We should prevent the components from updating the cursor when the popup menu is displayed. This one is not so easy to fix. Viable options are using GetWindow with GW_ENABLEDPOPUP to locate an activated popup menu (proven to work, but w2k+ only so should emulate on older systems), or handling WM_[UN]INITMENUPOPUP for the same purposes (this fix would be generally cleaner but less local). ###@###.### 2005-06-29 16:17:48 GMT
2005-06-29