I've had a bit of time to look at code and experiment a bit. On Wed 03 Mar 2021 at 13:51:48 +0100, Rhialto wrote: > I don't use SloppyFocus (just FocusFollowsMouse), and I noticed that for > instance xconsole does't seem to want input focus. And as a result, > keyboard shortcuts for window depth arrangement don't work on it.
Oops, I misremembered, that would be xload. You can see it with xprop:
WM_CLASS(STRING) = "xload", "XLoad"
WM_HINTS(WM_HINTS):
Client accepts input or input focus: False
Initial state is Normal State.
bitmap id # to use for icon: 0x800001
I've grepped through the current ctwm source, and I can find the
following places where SloppyFocus has an effect:
- HandleFocusOut() i.e. when a FocusOut message is received.
When SloppyFocus, all processing is skipped.
- HandleDestroyNotify() i.e. whena window has been destroyed.
When SloppyFocus, focus is placed on some other window.
- SetFocus() i.e. when we want to put focus on some window, or on no
window.
When SloppyFocus and the new window is NULL and the old window
is NOT an icon manager: skip all processing.
This means that via the icon manager a window CAN lose focus when the
new window is the root window, even if SloppyFocus is set.
- GotoWorkSpace() i.e. when switching workspaces.
When SloppyFocus, "the last window" is focussed.
and that's it.
I added SloppyFocus to my config, and xev worked (it printed events
(including mouse and key events) and its window got the proper
decoration for a focussed window). I tried with the most recent code
and with the released version in pkgsrc. Enabling icon managers didn't
change this.
With the ctwm included in 9.1 (still with SloppyFocus), xev did get
mouse events, but its window did not get the focus decoration change.
Keyboard events went to the previous window (which had the focus
decoration). I'd say that this is a bug compared to later versions. When
the mouse was in the icon manager, it did get key events (iirc, ctwm
forwards those explicitly).
If I were to analyze this, I would first start looking in the code for
HandleEnterNotify() and HandleLeaveNotify(). The latter has a very big
comment blob about various subcases.
But based on my findings so far, I think updating the ctwm included with
NetBSD would improve SloppyFocus behaviour (and deeply diving into the
old version's HandleEnterNotify() seems not so useful at this point).
-Olaf.
--
___ Q: "What's an anagram of Banach-Tarski?" -- Olaf "Rhialto" Seibert
\X/ A: "Banach-Tarski Banach-Tarski." -- rhialto at falu dot nl
signature.asc
Description: PGP signature
