Re: Alt+Tab behavior [ now with experimental code on a branch ]
Rhialto <[email protected]> Sun, 27 Dec 2020 18:51:57 +0100
| Newsgroups | gmane.comp.window-managers.ctwm |
|---|---|
| Message-ID | <[email protected]> |
So, after some thinking I made a first go at a window ring that behaves
like a stack.
Based on the following observations:
- The difference between a window ring and a stack is effective at
the moment the modifier key is released.
- at modifier-down time, we remember the "top of the stack".
- at modifier-up time, we move window we moved to (if any) to the top
of the stack.
- So if we can do some administrative work both when the modifier is pressed
and when it is released, we can make a ring into a stack.
- We can already make bindings for pure modifier keys.
- All current bindings are for key-down events.
- We can make bindings for key-up events if we pretend this is a new modifier.
# This makes bindings for the usual window ring:
"Tab" = m4 : all : f.warpring "next"
"Tab" = m4 | s : all : f.warpring "prev"
"Return" = m4 : all : f.ring
# This turns the window ring behaviour into a stack behaviour:
# Note that the Super key corresponds to modifier 4.
"Super_L" = : all : f.warpring "startstack"
"Super_L" = up | m4 : all : f.warpring "finishstack"
You can find a branch at
https://code.launchpad.net/~ctwm/ctwm/windowstack
(lp:~ctwm/ctwm/windowstack). I guess that's a "ctwm" more than needed
but I had to try a few times to get the syntax right and I didn't want
to overwrite trunk.
There are some things in it that I'm not so happy about yet.
- Names of things. startstack and finishstack aren't the best names, but
the code in f.warpring looks at the first letter only right now to
decide, so I wanted distinct first letters.
- I factored out some code to manipulate the window ring (add and remove
a window) and I'm not sure in which source file that belongs.
- There are probably some edge cases that this code doesn't handle. I
tested it lightly and that seemed to work though.
-Olaf.
--
Olaf 'Rhialto' Seibert -- rhialto at falu dot nl
___ Anyone who is capable of getting themselves made President should on
\X/ no account be allowed to do the job. --Douglas Adams, "THGTTG"
signature.asc
(application/pgp-signature, 484 B)
-----BEGIN PGP SIGNATURE----- iQEyBAEBCAAdFiEEFVAhiiWjqgwBVdQAmYnGRWHD+9MFAl/oybgACgkQmYnGRWHD +9Np+QfyAz8wOY2Jaf5GTGT9bwdt9ywASoVMc7NPAEKdTsD578ydjC+f0YEENYb0 9d3K6baAyq+WskwpFdHQCtf4DXofpvhHKKn9/HFQgpVs45yWy1U76VknybM+g60O prsvxySiTKjp2pBRDcMgnAqpG23k1ZutgVuhmaGlpNz8oQWWpbTMVatmQ6MsjwTG zQI06IvWGVcMOk6D+yuG8bjmo5pvN45uhzRdecWAb094EWCzwP7YwnnyCm+EU9mL VskZtgIEnRbhkcqI7Zf3tORnAqGxQupHl5aWunJ2JZj1LmOEMZosOCGeaOqcYlC0 XF89WcuKbaRZwCuB4csge9w3Vx0k =g4yo -----END PGP SIGNATURE-----