RFR: 8342096: Popup menus that request focus are not shown on Linux with Wayland [v5]

Alexey Ivanov aivanov at openjdk.org
Wed Jan 29 15:56:50 UTC 2025


On Fri, 24 Jan 2025 21:23:02 GMT, Alexander Zvegintsev <azvegint at openjdk.org> wrote:

>> The previous [JDK-8319103](https://bugs.openjdk.org/browse/JDK-8319103) fix was not complete.
>> 
>> The case where a menu item with a focusable component was not a direct child of a window was missing(failing the `if (window == oppositeWindow.getParent() ) {` check), so the ungrab event was posted prematurely.
>> 
>> This can be fixed by adding `waylandWindowFocusListener` to all submenus in hierarchy.
>> 
>> The manual test updated to use this case, and also added an automated test that checks that it didn't close prematurely.
>
> Alexander Zvegintsev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   review comments

Marked as reviewed by aivanov (Reviewer).

test/jdk/javax/swing/JPopupMenu/NestedFocusablePopupTest.java line 96:

> 94:     }
> 95: 
> 96:     static Rectangle waitAndGetOnScreenBoundsOnEDT(Component component) throws Exception {

Suggestion:

    static Rectangle waitAndGetOnScreenBoundsOnEDT(Component component)
            throws InterruptedException, TimeoutException, ExecutionException {

For consistency with `waitTillShown` which lists exceptions.

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

PR Review: https://git.openjdk.org/jdk/pull/22729#pullrequestreview-2581484518
PR Review Comment: https://git.openjdk.org/jdk/pull/22729#discussion_r1934141378


More information about the client-libs-dev mailing list