On Sat, Jul 04, 2026 at 08:49:02AM +0200, NilsOla Nilsson wrote:
> The "focus previous" is a very good improvement. If you
> open a shell for a fast check and the closes it f.ex.
> 
> [...]
>
> not always. Focus is never preserved which often, at
> least for me, means that I start writing in another
> window than what i meant to.
> 
> This seems to be Aric's problem as well.
> 

Let's see if what I'm about to explain helps everyone to organize
ideas.

In cwm the default behavior is to give focus to the window where the
pointer lands.  The cases where this doesn't happen is because, for
convenience, it's avoided through some hack.  One of these hacks is
making the pointer jump (warp), for example when we 'create' a window;
otherwise, the new window wouldn't gain focus.  Another example is when
you change focus from one window to another without using your mouse (or
from your keyboard with pointer-move.)

If, like me, you prefer the keyboard, any time you want to go back to
(or alternate with) the window you were previously working on, you
depend on the cycle stack (don't confuse this with "layers", cwm does
not support layers.)  In cwm the function to do this is window-cycle (I
bind it to Ctrl-Tab, as in most modern window managers.)  The dynamic of
this feature is negatively affected by mouse focus: every time you move
the pointer, whether intentionally or accidentally, any visible window
under its trajectory is loaded in the cycle stack.  In the so-called
"strict" mouse focus you'll find in many window managers, this also
happens when you close or un-maximize a window.  Then, when you cycle
back with the intention to focus and raise the window you were working
on, you first have to pass throw all those ones that accidentally won
the focus.  As if this were not enough, if when closing the active
window the pointer lands on the root window, an extra unwanted step is
added to the cycle.

Many noticed that the so-called "click to focus" does not suffer from
this problem, this is the reason for the existence of the many variants
of the "sloppy focus" we find in all window managers for X11, which are
mostly an attempt to alleviate this inconvenience of mouse focus by
reducing the number of cases in which the active window accidentally
loses the focus or the focus is passed to a random one.  An attempt to
have the best of both worlds.


-- 
Walter

Reply via email to