Files
komorebi/docs/usage/resizing-windows.md
T
LGUG2Z af560f47d7 feat(wm): resize by dragging an edge
Dragging an edge or a corner of a tiled window resizes its tile when the user
lets go: each edge of the tile moves by what the pointer moved it, the neighbors
give up or take the room, and the window is put on its tile.

A drag is measured from the frame the window had when the user took hold of it,
edge by edge, and resizes the container of the window that was dragged, through
resize_window and so within its bound (no tile below a tenth of the work area).
KWin reports the window's frame all through a drag, so the table keeps the frame
of the start for the window manager (Backend::drag_origin). At the end the frame
can still be short of the pointer, because KWin changes it once the client has
drawn at the new size; the bridge keeps the frame the last step of the drag
asked for and sends it as `requested`, and the end of a resize is that frame.
The window of a stack has the tile of the stack; a floating window and the
window of a monocle have none, and are left as the user made them.

The end of a resize is read apart from the window's frame, and that deviates
from the spike. The spike stores the frame the last step asked for as the
window's own frame, where the next frame event replaces it. KWin sends one a
millisecond after the end, with what the client has drawn so far (660 pixels of
the 672 asked for), and a window manager that is busy with an earlier event
reads that frame when it handles the end: a tile moved by 60 pixels for a drag
of 72. Here the table keeps the end apart (Table::drag_end, and
Backend::drag_end for the window manager, None by default), ResizeEnd reads it
as ResizeStart reads drag_origin, and the window's frame stays the one KWin
reports. A resize that sent no step ends at the frame. The order that failed is
a test of the KWin backend with the real table and window manager, in which the
tile took 140 of the 200 pixels without this.

komorebi-layouts at the pinned revision has the fix of LGUG2Z/komorebi#1765, so
nothing is vendored, and docs/drag-resize.md says what a drag does and why each
rule is there. vm-drag-resize drags edges and corners of three tiles with the
pointer that the session node has (komorebi_vm.Pointer), whose moves are batched
in the guest. The suite drags against the daemon the module starts with the
session, and reads the drags that daemon has handled from the unit's journal.

vm-drag-resize waits, for 30 seconds at most, for the daemon to have the room
KWin takes for the panel before it opens the windows (Kde.wait_for_panel_room).
The panel moved every tile in the middle of a case that began before the daemon
learned of it, which showed as an edge that was not dragged. It is a wait and
not a check, since a session that is too slow may never take the room.
2026-10-28 07:20:57 -07:00

3.2 KiB

Resizing windows

komorebi resizes the focused window by moving the edges of its tile, and its neighbors give up the room. A window can also be resized by dragging one of its edges. The size a tile has been given is kept until the workspace is retiled with komorebic retile, so it lasts while windows open and close around it.

An edge

komorebic resize-edge (or resize) moves one edge of the focused window: left, right, up or down, and increase moves it outwards, decrease inwards.

komorebic resize-edge left increase
komorebic resize-edge right decrease

An edge with no tile on the other side of it, such as the left edge of the first window in the BSP layout, does not move. Neither does an edge the layout keeps where it is: the grid layout has no resizing at all, and in the columns layout a window can only be made wider or narrower.

An axis

komorebic resize-axis moves both edges of the focused window along an axis: horizontal the left and the right edge, vertical the top and the bottom edge, and horizontal-and-vertical all four.

komorebic resize-axis horizontal increase

How far

komorebic resize-delta sets how far a resize goes, in pixels: an edge moves by half of it. The delta starts at 50, so an edge moves by 25 pixels.

komorebic resize-delta 100

A resize never makes a tile narrower or shorter than a tenth of the monitor's work area, unless the tile is smaller than that already: a resize that would is carried out as far as it can go.

By dragging an edge

Take hold of an edge or a corner of a tiled window with the pointer, drag it, and let go: the edges of the window's tile move by as much as the pointer moved them, the neighbors give up or take the room, and the window is put on its tile. A corner moves two edges. The rules are those of resize-edge: an edge with no tile on the other side of it does not move, and the window goes back to its tile; no tile is made smaller than a tenth of the work area, so a long drag goes as far as it can. The window of a stack has the tile of the stack. A floating window and the window of a monocle have no tile: they are left as the user made them. Resizing a tile by dragging its edge says how a drag is measured.

Back to the layout

komorebic retile tiles every monitor again in its layout, without the sizes the tiles were given. To tile again and keep them, send the RetileWithResizeDimensions message, which has no subcommand of its own.

Saving and loading the sizes

The sizes the tiles of the focused workspace were given can be saved to a file and loaded back, on the same workspace or another one with as many windows:

komorebic save-resize ~/sizes.json
komorebic load-resize ~/sizes.json

komorebic quick-save-resize and komorebic quick-load-resize do the same with one file the daemon keeps in its temporary directory, komorebi.quicksave.json in $TMPDIR (or /tmp). A path given to save-resize and load-resize can name environment variables, which komorebic expands.