On Tue, 21 Jan 2025 10:13:26 GMT, Alexander Zvegintsev <azveg...@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: > > formatting Initial testing looks good. Still in the process of reviewing the fix. test/jdk/javax/swing/JPopupMenu/NestedFocusablePopupTest.java line 105: > 103: > 104: static void test1() throws Exception { > 105: Point frameLocation = frame.getLocationOnScreen(); Is it better to have .getLocationOnScreen() calls within EDT? Since getLocationOnScreen() has the possibility of throwing IIlegalCompnentStateException, do we check if the component is visible before calling getLocationOnScreen() especially in the context of pop menus and sub menus ? ------------- PR Review: https://git.openjdk.org/jdk/pull/22729#pullrequestreview-2566015041 PR Review Comment: https://git.openjdk.org/jdk/pull/22729#discussion_r1924576095