A window that opens goes after the focused container. A workspace can now say
another place for its windows: the primary or the secondary tile, before or
after the focused container, the end of the list, or a place by number, counting
from 1. The place is for every window, or for the windows that match a rule on
their program, app id, title or path; the rules are the conditions the ignore
and manage rules are made of, and the first that matches in key order decides. A
place that does not exist, such as the secondary tile of a workspace with one
container, is the default place.
A place is read from a name, a number or text that is a number. The
documentation of the setting shows a number and a map's keys can only be text,
and komorebi for Windows (83c4e11d) reads only text, so the form its own page
shows is refused there.
A place that was reserved with preselect-direction is used before the rules are
asked, and a locked container keeps its index. A workspace whose
window_container_behaviour is Append puts a window in the focused container, and
the rules are not used.
A workspace takes the rules from the key initial_window_placement_rules of its
entry in komorebi.json. The key is in schema.json and so in the typed config
option of the module, and the page docs/initial-window-placement-rules.md says
how to write it. vm-placement opens windows in a headless KWin and checks where
they go, by program, app id and title.
The schema that schemars derives for a place is an object with a Placement or an
Index key, which is not what is read or written, so a check against it refuses a
file that the daemon reads. The schema of PlacementTarget is written by hand
instead: a name, a number, or text that is a number. A file with a place of each
form is checked against schema.json, and the module's config option takes them.
3.6 KiB
Maximizing windows
komorebic toggle-maximize has KWin maximize the window that has the
focus: it takes the work area of its monitor, the panels left alone, and has no padding around it.
The window leaves the layout while it is maximized, and the same command restores it and puts it
back in a container of its own, at the place in the order of the workspace it was taken from.
A window you maximize yourself, with its title bar, a double click or a shortcut, is treated the
same way: see A window you maximize.
komorebic toggle-maximize
A window that is the only one of its container takes the container with it, and the container is made again when the window comes back. The tiles that were left are not moved while the window is maximized: it covers them. A window that opens meanwhile is added to the layout, where a new window goes (after the focused container, unless the workspace has placement rules), and has its tile when the maximized window is restored. A window that closes while it is maximized takes the maximize with it, and the other windows are tiled again.
A window in monocle that is maximized leaves the monocle. When the monitor of a maximized window is unplugged, the window goes to a monitor that is left and stays maximized: see Changing monitors.
A window you maximize
KWin tells komorebi when a window is maximized or restored, whoever did it. A window you maximize
leaves the layout as it does for toggle-maximize, and the tiles that were left are not moved
while it is maximized. A window that was floating or in monocle leaves that as well.
If another window is maximized already, it goes back to its tile. A window that is already
maximized when komorebi starts, or that opens maximized, is the maximized window from the start.
When you restore the window, with its title bar, a double click or a shortcut, it goes back in a
container of its own at the place it came from, as if toggle-maximize had restored it; a window
that was floating comes back as a tile. toggle-maximize restores a window you maximized, too.
Only a window that KWin has maximized both ways counts: a window maximized in one direction only,
which a shortcut can do, is a restored window to komorebi.
What is left alone
While a window is maximized, by toggle-maximize or by you, the commands that are about the tiles
of the layout do nothing, and the daemon logs that it ignores them: move,
cycle-move, the stack commands,
promote and the other promote commands,
resize-edge and resize-axis,
preselect-direction, toggle-lock,
toggle-float, toggle-monocle, and the
commands that move or send a container to another monitor or workspace, such as
move-to-monitor and
send-to-workspace. Restore the window first.
komorebic focus finds no container on any side of the maximized window, so
the focus goes to the monitor on that side, and the command fails where there is none. A
maximized window, or a window in monocle, on the workspace it reaches is given the focus whole.
In the daemon's state
A workspace with a maximized window has it as maximized_window, which is not in its
containers, and the index it goes back to as maximized_window_restore_idx.