Chris Barry
I am using a standard Arch Linux installation with X11 and, usually, icewm. I first noticed this problem around 4 months ago. I do not know precisely when because, at first, I thought it was a problem with the mouse button switch, or possibly the USB hub.
The problem is a failure to restore keyboard focus to the main window after it has been removed in quite specific circumstances.
With jedit, which is a java-based programmer's editor, the program starts and runs normally. However, if I open a dialog box, for example to go to a specific line, or to search, while the dialog is open everything is normal but when it is closed the main window no longer has the focus and (I think this is significant) clicking on its title bar will not restore the focus. The window is displayed as inactive and does not respond to key presses.
If I switch to another window in the same workspace, then switch back, focus is restored.
A similar state results if I switch to a different workspace while a susceptible window (jedit or wine) has the focus, and then switch back. On return to the original workspace no window will appear active, and clicking on the previously active window's title bar will not restore the focus.
I have tried different java runtimes, an older version of jedit, a different window manager (fvwm3 instead of icewm), different display managers (slim and xdm) and now a complete reinstallation of Arch Linux. The problem remains.
With wine I only see the problem when switching workspaces, but it happens with both the Arch 32 bit binary and a wine64 which I built myself. Both version 8.13. The symptoms are completely consistent and reproducible.
To me the symptoms point to a recent change in X11 being responsible, but I am not sure how I would go about investigating that. I could try switching to Wayland, but that doesn't look like a change that should be undertaken lightly, and in any case I would rather fix the problem than bypass it.
Any suggestions?
I appear to be talking to an empty room, but just in case someone should wander by -
I tried some other window managers.
I could not get anything but a blank screen from Gala, evilwm shows the same symptoms as icewm and fvwm, but blackbox and fluxbox work correctly (that is to say, as I want them to work).
Since this affects several unrelated (as far as I know) window managers and seemed not to be linked to a change in icewm (when I noticed the behaviour I tried reverting to an earlier version, but perhaps I did not go back far enough), it must be due to a change in some underlying software, a configuration change, or a hardware fault. My hard disk recently (that is, I noticed it recently) started quietly dropping clusters. This was my main reason for reinstalling the OS (on a new HD) but I hoped that it might cure the focus problem. I am not aware of having made any significant configuration changes, which leaves software.
I originally thought it might be a change in Xorg, but from what I have been able to learn, Xorg now does very little and probably does not even have a concept of keyboard focus and anyway I have not seen anything that looked likely to be relevant in its commit log. This leaves the possibility of a change in a common library. Maybe I should run hdd on a selection of window managers and look for significant changes.
That was an idea that occurred to me as I was writing, so perhaps there has been some benefit to this exercise, even if I am only addressing the TopAnswers teddy bear.
Top Answer
Anonymous 13058
Misbehavior is common for Java windows, try wmname LG3D as in https://wiki.gentoo.org/wiki/Dwm.