feat(wm): tune layouts, and the scrolling layout

`komorebic layout-ratios --columns ... --rows ...` sets the share of the work
area the first columns and rows of the focused workspace's layout take, and
`scrolling-layout-columns N` how many columns of the scrolling layout are in
view. Both are layout options of the workspace, which komorebi-layouts reads.

The scrolling layout is a strip of columns that runs past the edges of the work
area, so its tiles are not clamped to it: the windows of the columns out of view
are off the screen. When a window of a scrolling workspace gets the focus, the
workspace is tiled after the focused container changed, which scrolls the strip
to it.

KWin moves a window anywhere, but keeps 100 pixels of a window it resizes on an
output once the client has drawn at the new size, which pulls the columns out of
view back onto the screen. The bridge remembers the position it was asked for,
for a second, and asks again for the position alone when KWin moved the window
elsewhere, three times at most.

komorebi-layouts compiles `Rect::percentage_within_horizontal_bounds` only with
its darwin feature, which this repository does not enable, so the workspace has
its own copy of it.

A new VM suite, vm-scrolling, after the spike's m2-scrolling script, checks in a
real KWin that the columns out of view stay where komorebi put them and that the
strip follows `komorebic focus`; vm-commands sweeps the two new commands.
This commit is contained in:
LGUG2Z committed 2026-10-28 07:20:37 -07:00
1 parent 41c32aad8e
commit 37b06993d2
23 files changed
+908 -39

No files matched your search

+13
View File
@@ -210,3 +210,16 @@ So that the tests exercise the module. Every VM suite boots a machine that impor
the module's read-only `execStart`, and the session node runs the module's unit itself. A change
to the module that breaks how komorebi is installed or started fails the VM suites, and not only
`nixos-module-eval`.
## Why does the bridge ask KWin twice for the position of a window?
KWin moves a window anywhere it is asked to, but when it resizes a window it keeps 100 pixels of
it on an output, and it does so once the client has drawn at the new size, which is after the
bridge has set the frame. The scrolling layout moves the windows of the columns out of view off
the screen and resizes them in the same command, and a terminal that rounds its size to its
cells is resized again by its client, so KWin pulls both back onto the screen. By then, setting
the position alone is a plain move, which KWin honors. The bridge remembers where it was asked
to put a window for a second, and sets the position again when the window's frame changes to
another one in that time ([PLATFORM.md](PLATFORM.md#how-clients-answer-a-frame)). Three tries
at most keep it from chasing a window that cannot go where it was asked, such as a fullscreen
one.