On Sat, Oct 13, 2018 at 07:31:50PM +0200 I heard the voice of
Tadziu Hoffmann, and lo! it spake thus:
>
> Btw, ctwm apears to want both "InputHint" as well as "input" to be
> set: resetting any of the two to zero results in the behavior you
> originally described.
hints->input says whether the window wants input focus. flags |=
InputHint says "I've set ->input to something". After all, it's
impossible to have ->input unset; it'll always be something. The hint
says whether it's something we should pay attention to, or just random
memory garbage.
On Thu, Oct 11, 2018 at 09:24:45PM -0400 I heard the voice of
Wayne Cuddy, and lo! it spake thus:
>
> I also tried the ForceFocus setting in .ctwmrc but that didn't seem
> to have a noticeable effect.
So, there are 3.5 ways we can wind up thinking a window should get
focus.
1) It can tell us ->input=1 (with the hint flag), in which case, it's
got it.
1.5) It can give us no WM_HINTS at all, in which case we fake up a
set for it, which has ->input=1.
2) It can tell us nothing about the flag (InputHint not set), in which
case we arbitrarily decide to give them focus (xvile hit this when
the window was created, and so it got focus).
3) It can be in the ForceFocus list, in which case it gets ->input=1
_even if_ it set InputHint and gave up input=0, specifically
telling us "no, really don't give me input".
> - start multiple copies of xvile and restart ctwm (f.restart), after
> this focus is simply controlled with the mouse in the usual fashion
This is the key. Not the multiple copies; that's irrelevant; the
restart. When we initially adopt a window, we do all that adjustment
listed above. So when you start up xvile, it goes through that. When
you restart ctwm, it finds xvile in the list of windows on the screen,
and goes through that as well.
But, when xvile _changes_ its WM_HINTS after it's running, we were
just accepting them without doing any adjustment. So that's what's
happening; xvile starts up, tells us nothing about focus at all, so we
decide to force input=1. But then after we've adopted the window, it
_reset_ its WM_HINTS, telling us nothing about focus, and so we wound
up not focusing it. When you restart ctwm, it's after xvile has
already reset WM_HINTS, but we go through the whole initial setup that
DOES the overriding.
I've shuffled things around so the munging happens when WM_HINTS
changes just like it does when the window is first created, so if you
try out trunk with a stock (definitely bogus; they should fix that)
xvile, it should get focused normally now.
--
Matthew Fuller (MF4839) | [email protected]
Systems/Network Administrator | http://www.over-yonder.net/~fullermd/
On the Internet, nobody can hear you scream.