RFR: 8361606 : ConsumeNextMnemonicKeyTypedTest.java fails on Windows: character typed with VK_A: a
Damon Nguyen
dnguyen at openjdk.org
Mon Aug 25 10:18:54 UTC 2025
On Thu, 14 Aug 2025 23:38:02 GMT, Anass Baya <abaya at openjdk.org> wrote:
> **Analysis :**
> When the problem occurrs, the key press event related to the mnemonic triggers the item selection. However, as we returned to the menu, the subsequent key typed event arrived and was treated as a normal key press instead of being recognized as part of the mnemonic sequence.
>
> **Proposed Fix:**
> As a fix, we are tagging the next key typed event to be consumed by the Keyboard Focus Manager
>
>
> public void processKeyEvent(Component focusedComponent, KeyEvent e) {
> // consume processed event if needed
> if (consumeProcessedKeyEvent(e)) { <--- consumed here
> return;
> }
> ...
I tried running this test on Windows and the test passes without any changes. I saw in the bug that this is intermittent. How does this change to `BasicPopupMenuUI` fix the root cause of the intermittent issue?
Looks like the change is also in any instance where the action is on a non-JMenu object, which means this change might possibly affect other UI components as well other than what we expect for this intermittent failure.
Also a side-note, this test fails for me on macOS when the problemlist is for `linux-all`. And the de-problemlisting of this test may not be needed. This issue is for the windows failure it seems. There's a separate issue for the intermittent linux failure [JDK-8321303](https://bugs.openjdk.org/browse/JDK-8321303).
-------------
PR Review: https://git.openjdk.org/jdk/pull/26790#pullrequestreview-3150803629
More information about the client-libs-dev
mailing list