feat(wm): a window the user maximizes

KWin maximizes a window for the user as well as for komorebi: the title bar, a
double click and a shortcut do it, and nobody asks the window manager. A window
that stayed a tile would be asked to move at the next retile, so komorebi has to
know.

The bridge reports KWin's maximizedChanged as a maximized event, true only when
the window is maximized both ways. The table turns it into a MaximizeChange, and
adopt_maximize_change takes the window out of the layout as toggle-maximize
does, or, when the user restores it, puts it back in a container of its own at
the index it came from. A window that is already maximized when komorebi starts,
or that opens maximized, is the workspace's maximized window from the start.
komorebi's own maximize is reported too and finds the workspace as it left it,
so it changes nothing.

While a window is maximized, what is asked of the layout does nothing, by the
same rule as for toggle-maximize.

A maximized window of a monitor that is unplugged goes to the monitor that is
left and stays maximized: evacuate_monitor makes it the maximized window of the
workspace it goes to, and the maximized window that workspace had goes back to
its tile. Until now it came back as a tile.

vm-user-maximize maximizes windows with kdotool in a headless KWin, and checks
the daemon's state, the frames, that the layout commands do nothing, and that
toggle-maximize and the user's restore both put the window back in its tile.
This commit is contained in:
LGUG2Z committed 2026-10-28 07:20:57 -07:00
1 parent 0210ec285a
commit d6ad3b4292
31 files changed
+1246 -88

No files matched your search

+3 -2
View File
@@ -41,8 +41,9 @@ KWin takes the windows of an output that goes (it is unplugged, or disabled with
likes. komorebi takes the monitor's workspaces over there: every container, and every floating
window, goes to the workspace with the same number on the monitor KWin put its window on, and
the workspaces that changed are tiled again. A [stack](stacking-windows.md) goes as a stack. A
monocle window and a maximized window come as tiles of their own, and the windows the monocle hid
are shown again.
monocle window comes as a tile of its own, and the windows the monocle hid are shown again. A
[maximized window](maximizing-windows.md) stays maximized, on the workspace it goes to; if that
workspace has a maximized window already, it goes back to its tile.
A moment after an output goes or comes back (1.5 seconds), komorebi looks at where every window
is once more, because KWin moves windows about for a while after the outputs change: the windows
+24 -5
View File
@@ -4,6 +4,8 @@
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](#a-window-you-maximize).
```sh
komorebic toggle-maximize
@@ -15,14 +17,31 @@ maximized: it covers them. A window that opens meanwhile is added to the layout,
container, 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](monocle.md) that is maximized leaves the monocle.
A window in [monocle](monocle.md) 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](changing-monitors.md#a-monitor-is-unplugged).
## 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](monocle.md) 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, the commands that are about the tiles of the layout do nothing, and
the daemon logs that it ignores them: [`move`](../cli/move.md), [`cycle-move`](../cli/cycle-move.md),
the [stack](stacking-windows.md) commands, [`promote`](../cli/promote.md) and the other promote
commands, [`resize-edge`](../cli/resize-edge.md) and [`resize-axis`](../cli/resize-axis.md),
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`](../cli/move.md),
[`cycle-move`](../cli/cycle-move.md), the [stack](stacking-windows.md) commands,
[`promote`](../cli/promote.md) and the other promote commands,
[`resize-edge`](../cli/resize-edge.md) and [`resize-axis`](../cli/resize-axis.md),
[`preselect-direction`](../cli/preselect-direction.md), [`toggle-lock`](../cli/toggle-lock.md),
[`toggle-float`](../cli/toggle-float.md), [`toggle-monocle`](../cli/toggle-monocle.md), and the
commands that move or send a container to another monitor or workspace, such as