Closed marcushg closed 9 years ago
Java desktop applications are weird in some sense. Because they create windows without override-redirect set, some window managers just manage them all. But we cannot do this in EXWM. I'll try IDEA and see if I can find a solution.
Thank you very much.
It's only getting weirder - I am going through several similar bug reports and solutions in other window managers -- all the while reading the OpenJDK code for AWT to better unterstand their focus handling and it's littered with if statements to check for a specific window manager..... e.g. on xmonad the recommended solution is to set the WM name to LG3D because there's special treatment for it in the JDK source :confused:
Hi @marcushg
Java GUIs are not playing well with any tiling window manager. Setting the WM name to this normally allowed to make Java applications somehow usable. There is one more environment variable which is often used:
_JAVA_AWT_WM_NONREPARENTING=1
This helped in xmonad and awesome, for exwm this may or may not help, but it is probably worth a try.
Hi @mgudemann
thanks for your help!
Unfortunately I have already been bitten by this problem in the past since I have been a xmonad user until now, where at least the WM name workaround helped.
I tried the _JAVA_AWT_WM_NONREPARENTING variable before, but without success and I guess it's due to xmonad and awesome actually being non-reparenting WMs while EXWM is not. Right now it seems I can't see the forest for the trees anymore, it looks like we're following the ICCCM protocols for "global active" input mode while there's something strange going on in the JVM :confused:
Fixed in b35430429e96ce6b2bb46a4d155d86acdba8d768. Should not require the workarounds of faking window manager name and setting the environment variable.
I've been using EXWM as my window manager for some time now and it is getting better and more stable with every commit (thanks everyone involved) - except for some java applications, e.g. Intellij Idea. When I am using the "Navigate to class" shortcut in Intellij and the dialog pops up it is immediately closed again (since it is losing focus). This is an age-old problem with java and window managers, mostly those non-reparenting ones.... but I saw that you already included support for java applications in exwm-manage.el :-)
It looks like that the check for the window type in exwm-manage.el is too restrictive (only _NET_WM_WINDOW_TYPE_NORMAL) in this case. The popup in question is of type _NET_WM_WINDOW_TYPE_DIALOG (with exwm-instance-name being "sun-awt-X11-XDialogPeer"). I confirmed that it is working as expected if i relax the check to either _NET_WM_WINDOW_TYPE_NORMAL or _NET_WM_WINDOW_TYPE_DIALOG and don't manage that window. But I guess there's a reason you explicitly added the _NET_WM_WINDOW_TYPE_NORMAL check.... EDIT: well one reason - other java dialogs are now unmanaged, too - but I fail to see different X11-properties on longer lived dialogs vs short lived popups, to differenciate between them (override-redirect is not set and both have a transient-for window set)
Someone created a minimal test project to reproduce the java popup problem for another window manager which you can use the check it yourself: qubes-java-focus-issue