Building & running, run from your shell
javac SimpleMenuEx.java
java SimpleMenuEx
#Reproducing To reproduce issue, resize window from top left corner (using mouse) and try selecting one submenu. Focus will be shifted without custom wmname or with wmname LG3D.