On Thu, 22 Feb 2024 11:11:01 GMT, Abhishek Kumar <abhis...@openjdk.org> wrote:

> Menu mnemonic doesn't toggle between show and hide state when F10 is pressed. 
> Behavior is not similar to windows native application. Fix is to ensure that 
> menu mnemonic state toggles between show and hide.
> 
> Can be verified with SwingSet2 application. 
> CI tests are green with the fix. Link posted in JBS.

> Based on the above comment, additional changes are required. F10 in Windows 
> L&F should release focus from the menu bar.
> 
> Alt key handles this, see 
> [`WindowsRootPaneUI.AltProcessor`](https://github.com/openjdk/jdk/blob/a93605f7fb0fbe22c7bdffc8eb6db4d660eec3d1/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsRootPaneUI.java#L80)
>  for ideas.
> 
> Let's see what happens to Notepad on Windows 10.
> 
> Pressing F10 key selects the File menu in the menu bar and displays 
> mnemonics: ![File menu in the menu bar is selected after F10 is 
> pressed](https://private-user-images.githubusercontent.com/70774172/308615604-839bd2eb-cee0-4b15-b0ab-f7f2377f9650.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDkxMzU3OTQsIm5iZiI6MTcwOTEzNTQ5NCwicGF0aCI6Ii83MDc3NDE3Mi8zMDg2MTU2MDQtODM5YmQyZWItY2VlMC00YjE1LWIwYWItZjdmMjM3N2Y5NjUwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAyMjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMjI4VDE1NTEzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY0ODhmNjMwYTczMTZiNzU3MmE0NzU5ZjY4NTRlNjAyNGE1ZTU2OTdjYjI1MDllM2ViOGY4NzMzMzcwOWY1OWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.QNCWDq268DHqwysEP8v1eMtoJ_4cio5GNcz3Mh2X38g)
> 
> Pressing F10 for the second time, unselects the menu and hides mnemonics: 
> ![File menu in the menu bar is not selected any 
> more](https://private-user-images.githubusercontent.com/70774172/308616648-66bfd26d-182c-4789-8998-796bb86ace24.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDkxMzU3OTQsIm5iZiI6MTcwOTEzNTQ5NCwicGF0aCI6Ii83MDc3NDE3Mi8zMDg2MTY2NDgtNjZiZmQyNmQtMTgyYy00Nzg5LTg5OTgtNzk2YmI4NmFjZTI0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAyMjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMjI4VDE1NTEzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY5ZGVmYzIxMjgzOWZmZWExZDgzYzVhODY3YjM3MTRlMjAwYjI5NGY1YjJmN2MwNGNjMzA1ODhlMmRhMWQ5ZWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.FkB7lGHCi6N_-tnAg8eOnyUHICfxtSi3Qi_GVeFZ6_I)

@aivanov-jdk Yeah, I am working on it.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17961#issuecomment-1969284634

Reply via email to