RFR: 8155030: The Menu Mnemonics are always displayed for GTK LAF [v8]
Abhishek Kumar
abhiscxk at openjdk.org
Mon Jun 24 06:25:11 UTC 2024
On Fri, 21 Jun 2024 20:08:58 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
> Wouldn't it be easier to install altProcessor always in SynthLookAndFeel.initialize and to uninstall it in SynthLookAndFeel.uninitialize like it's done in WindowsLookAndFeel:
https://github.com/openjdk/jdk/blob/master/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java#L197-L198
Then altProcessor would do nothing if the RootPane.altPress property isn't set or is false.
In my initial fix, I added the `altProcessor` handler in `SynthLookAndFeel.initialize` with condition check for GTK L&F. Phil has suggested not to check for GTK L&F instead look for some alternate way like mentioned [here](https://github.com/openjdk/jdk/pull/18992#discussion_r1595782003).
Now I left with few options:
1. Install `altProcessor` handler similar to `WindowsLookAndFeel` implementation but that results in unnecessary installation of `alt handler for Nimbus L&F (derived from Synth L&F)` as well.
2. Add the `RootPane.altPress` condition check before installing the `altProcessor` handler but the value returned for `RootPane.altPress` is always **false** and that left with `altProcessor` handler uninstalled.
So, the handler implementation is moved to `SynthRootPaneUI`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18992#discussion_r1650410849
More information about the client-libs-dev
mailing list