[Patch] twm: combined patchset

Eeri Kask Eeri.Kask at inf.tu-dresden.de
Sun Nov 25 16:21:52 PST 2007

Ed Schouten wrote:
> * Eeri Kask <Eeri.Kask at inf.tu-dresden.de> wrote:
>> In my opinion too, this would be a very helpful feature.  It would be
>> even perfect if in all places you can specify a window name in a list in
>> .twmrc you could use regexp notation generally.  (E.g., vtwm has it for
>> some years probably.)
>> (Probably all strcmp() calls in LookInList() and GetColorFromList() in
>> list.c are the starting place to look at.)  :-)
> Well, I'm not sure about that. We're supposed to keep it minimalistic,
> right? But I'm only saying this because I don't have a use for that
> (yet).
> Anyway: I've finished my patchset, consisting of three new features I
> wanted my twm to be capable of:
> 1. The wildcard support, which allows you to match all windows in
>    AutoRaise and, more important, WindowRing.

To be strict, momentarily "*" is not "wildcard support" but an alias for
"all windows".  :-)

> 2. Retaining focus when moving the pointer on the root window.

Unfortunately the mouse gets too sloppy as it stands in the final
version.  Test this:

(1) Put

    NoTitle { "XTerm" }

into .twmrc, start xterm, then xcalc.  (I assume xcalc has titlebar.)

(2) Now move mouse into xcalc, then into xterm.  How do you focus xterm?
 Probably only by killing xcalc. (Or doing f.unfocus to xcalc.)

Why that?

It appears twm is architected with the "focus follows mouse" from ground
up and everywhere in the code this policy seems to be assumed (excluding
the case one executes f.focus on some window explicitly, only then you
leave the "PointerRoot" mode).  Now it is true every titled window gets
focus explicitly assigned to that window (in HandleEnterNotify()), but
if you kill PointerRoot recovery in HandleLeaveNotify() no window
without a title bar is assigned focus in HandleEnterNotify(), they rely
on PointerRoot focus mode.  Destroy handler (as well as f.unfocus)
recovers PointerRoot mode.

Attached is an alternative initial attempt of the sloppy-mouse
functionality.  Mostly this is based on what f.focus does but adapted so
that it (1) should coexist peacefully with the PointerRoot overall
policy, (2) does not break the icon manager (keeps sending focus into
client windows if mouse is in icon manager, and so on).

This patchset is a "minimalistic implementation" in the sense that now
we don't have f.focus functionality: If one sets f.focus to some client
and then enters some other client, the focus warps over there as well.
To keep f.focus functionality probably some additional housekeeping
state is needed to distinguish SloppyFocus mode from focus tied to some

There may be (I hope only) some minor cosmetic bugs in this
implementation remaining, probably in drawing icon manager entries under
some conditions.

(Apply this patchset against plain Xorg twm-1.0.3 realease.)

> 3. Automatically focusing windows after they have been placed on screen.
> I've written the last patch, because I tend to use the keyboard a lot.
> It would be nice if I could just press a keycombo to start the terminal
> and have focus on it automatically. Right now you first have to move the
> mouse cursor on top of the window, which is awful in my opinion.

Why don't you use the already existing "WarpCursor" keyword for that?
There seems no apparent reason not to do that.  This only is maybe a
matter of taste:  to utilise existing keywords as much as possible than
inventing new ones for every feature. :-)


    Eeri Kask
-------------- next part --------------
A non-text attachment was scrubbed...
Name: twm-1.0.3-diff.SloppyFocus.tgz
Type: application/x-compressed-tar
Size: 2612 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20071126/fc7a5ca5/attachment.bin>

More information about the xorg mailing list