RFR: 8155030: The Menu Mnemonics are always displayed for GTK LAF [v5]

Damon Nguyen dnguyen at openjdk.org
Fri Jun 14 09:11:18 UTC 2024


On Fri, 31 May 2024 08:49:17 GMT, Abhishek Kumar <abhiscxk at openjdk.org> wrote:

>> In GTK LAF, the menu mnemonics are always displayed which is different from the native behavior. In native application **(tested with gedit**), the menu mnemonics toggle on press of `ALT` key. Menu mnemonics are hidden initially and then toggles between show/hide on `ALT` press. 
>> Proposed fix is to handle the `ALT` key press for GTK LAF and mimic the native behavior. Fix is similar to the `ALT` key processing in  Windows LAF. Automated test case is added to verify the fix and tested in Ubuntu and Oracle linux.
>> 
>> CI testing is green and link attached in JBS.
>
> Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Review comment fix

Simplification of conditional. Mnemonic with ALT looks good.

src/java.desktop/share/classes/javax/swing/plaf/synth/SynthGraphicsUtils.java line 677:

> 675:                 // Check to see if the Mnemonic should be rendered in GTK.
> 676:                 if (UIManager.getBoolean("RootPane.altPress")
> 677:                     && SynthLookAndFeel.isMnemonicHidden() == true) {

Suggestion:

                if (UIManager.getBoolean("RootPane.altPress")
                    && SynthLookAndFeel.isMnemonicHidden()) {


Functionally the same.

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

Marked as reviewed by dnguyen (Committer).

PR Review: https://git.openjdk.org/jdk/pull/18992#pullrequestreview-2117889637
PR Review Comment: https://git.openjdk.org/jdk/pull/18992#discussion_r1639518952


More information about the client-libs-dev mailing list