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

Alexander Zvegintsev azvegint at openjdk.org
Fri Dec 13 04:20:48 UTC 2024


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.

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

Commit messages:
 - 8342096: Popup menus that request focus are not shown on Linux with Wayland

Changes: https://git.openjdk.org/jdk/pull/22729/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22729&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8342096
  Stats: 133 lines in 3 files changed: 121 ins; 4 del; 8 mod
  Patch: https://git.openjdk.org/jdk/pull/22729.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22729/head:pull/22729

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


More information about the client-libs-dev mailing list