RFR: 8064787: [macosx] In Nimbus LaF, Ctrl+Alt mnemonic doesn't work

Phil Race prr at openjdk.org
Mon Jul 18 00:15:59 UTC 2022


On Thu, 14 Jul 2022 08:03:34 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

> In SwingSet2 application, "File" menu has a visible mnemonic set on F.
> 
> ![image](https://user-images.githubusercontent.com/43534309/178932400-ab70602a-9c4f-4cab-b3b7-0508b26d2ebe.png)
> 
> Now, in MacOS, with Aqua, Java (Metal), and Motif LaF, one can open the menu pressing Ctrl+Alt+F. 
> But with Nimbus L&F, to open File menu, you have to press Alt+F even on OS X.
> 
> It should work with Ctrl+Alt+F as sun/lwawt/macosx/LWCToolkit.java. getFocusAcceleratorKeyMask() 
> has CTRL_MASK | ALT_MASK
> 
> Fix is to add Menu.shortcutKeys in SynthLookAndFeel default table so that it can call SwingUtilities2.getSystemMnemonicKeyMask() which will call either LWCToolkit.getFocusAcceleratorKeyMask() or SunToolkit.getFocusAcceleratorKeyMask() depending on platform.
> 
> No regression test is added as it can be checked with SwingSet2 app.

Marked as reviewed by prr (Reviewer).

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

PR: https://git.openjdk.org/jdk/pull/9488



More information about the client-libs-dev mailing list