mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-12-01 12:44:10 +01:00
feat(wm): maximize
A window could be given the work area only as a tile of the layout, which has padding around it. `komorebic toggle-maximize` has KWin maximize the focused window instead: it gets the work area of its monitor with the panels left alone, and it leaves the layout, so that it is in no container. Toggled again, the window is restored, put in a container of its own at the index it was taken from, and the workspace is tiled again. The window is kept in the workspace as its maximized window, with the index it goes back to, and the state shows both. While it is maximized the workspace asks KWin to maximize it again on every tiling, and does not move the containers behind it. The messages that are about the tiles (move, stack, resize, promote, preselect, lock, float, monocle, and the ones that send a container to another monitor or workspace) are dropped before they are handled, since there is no tile to act on. Focusing in a direction finds no container on any side of it, so the focus goes to the monitor on that side, where a maximized window or a monocle is given the focus whole. Showing the workspace again restores the maximized window and focuses it ahead of the containers' windows. A window in monocle that is maximized leaves the monocle, and one that closes takes the maximize with it. Backend gets a maximize command, which does nothing unless a backend implements it; the fake desktop and the KWin backend do, and the bridge carries it out with KWin's own `setMaximize`. A maximize also makes the bridge forget the position it was last asked to put the window at, which it would otherwise set again on the work area's size when the window's frame changed within a second of a tiling. komorebi/tests/maximize.rs and maximize_commands.rs drive it against the fake desktop, with one monitor and with two. The bridge's tests and the backend's tests read the maximize command from the same fixture, so that what one sends is what the other carries out. vm-features is a new session suite that reads screenshots: the first thing it checks is that the maximized window fills the work area, is the one on top, and goes back to its tile; the vm-commands sweep runs the new command.
This commit is contained in:
1 parent
0d21dd332c
commit
05de20749b
31 files changed
+1501
-68
No files matched your search
@@ -79,7 +79,8 @@ user in by itself, as in nixpkgs' own `plasma6` test, and Plasma draws on the
|
||||
machine's display device. The login starts the module's unit, so komorebi runs
|
||||
in the session from the start, as on a user's machine; `render-smoke`, which
|
||||
checks that the session draws, turns it off. It is the node for anything that
|
||||
needs pixels. The choice of login manager is made in
|
||||
needs pixels: `features` reads what komorebi does from screenshots of it. The
|
||||
choice of login manager is made in
|
||||
[`nodes/session.nix`](../../nix/tests/vm/nodes/session.nix) and nowhere else;
|
||||
the file says how to switch to sddm, the other one that has been seen to work.
|
||||
Its display is 1280x800, because screenshots are taken of the machine's one
|
||||
@@ -127,10 +128,11 @@ the run.
|
||||
printed, failing the test if it fails. `state()` is the daemon's state as
|
||||
`komorebic state` prints it, `managed(workspace)` the number of windows the
|
||||
daemon has on a workspace of the first monitor, `managed_all()` the number it
|
||||
has on every workspace of every monitor (floating windows and monocle
|
||||
containers too), `containers(workspace)` the titles of the windows of each of
|
||||
its containers, `monocle(workspace)` those of its monocle container, and
|
||||
`focused_title(workspace)` the title of the window it has focused there.
|
||||
has on every workspace of every monitor (floating windows, monocle containers
|
||||
and maximized windows too), `containers(workspace)` the titles of the windows
|
||||
of each of its containers, `monocle(workspace)` those of its monocle
|
||||
container, and `focused_title(workspace)` the title of the window it has
|
||||
focused there.
|
||||
- `daemon` reads the daemon's view of the desktop from that log, at the debug
|
||||
level the nodes set: `daemon.events(log)` lists the window events it handled,
|
||||
in order, `daemon.window_ids(log)` maps a window's title to the daemon's id
|
||||
|
||||
Reference in new issue
Block a user