feat(wm): fullscreen is left alone

A fullscreen window covers its monitor on purpose. Moving it would take it out
of fullscreen, or be ignored, so Window::set_position does nothing for a
fullscreen window, and every move the window manager makes goes through it.

The bridge reports KWin's fullScreenChanged as a fullscreen event, and the table
keeps what it says, which is what the window manager asks. The window stays in
its container, and the others are tiled as if it were not fullscreen. When it
comes back from fullscreen, KWin gives it the frame it had before, which may not
be its tile any more, so the workspace is tiled again.

Section E of the features suite checks it in a real Plasma session: a fullscreen
window covers the monitor, a window that opens does not take it out of
fullscreen, and it is in a tile that overlaps no other when it comes back.
This commit is contained in:
LGUG2Z committed 2026-10-28 07:20:57 -07:00
1 parent d6ad3b4292
commit e563988258
21 files changed
+586 -38

No files matched your search

+23 -8
View File
@@ -50,10 +50,10 @@ that is added has its place here.
komorebi asked for it or the user did. It is in no container, so it has left the layout, until
it is put back in a container of its own where it was ([`Workspace::maximized_window`]).
- **Event**: what the compositor reports about a window: it was shown, destroyed, given
the focus, minimized or restored, maximized or restored from it, dragged by the user, put on
another workspace's desktop, or moved to another output; and that a monitor shows another
workspace ([`WindowManagerEvent`]). Two events come from komorebi itself: a command asks it to
manage the focused window, or to stop managing it.
the focus, minimized or restored, fullscreen or back from it, maximized or restored from it,
dragged by the user, put on another workspace's desktop, or moved to another output; and that a
monitor shows another workspace ([`WindowManagerEvent`]). Two events come from komorebi itself:
a command asks it to manage the focused window, or to stop managing it.
- **Message**: what a client sends the daemon on its socket, a [`SocketMessage`]: an order
(focus a window, move it, change the layout, resize it, show a workspace, retile, stop) or a
question (the state, the monitors, one [`StateQuery`]).
@@ -113,10 +113,10 @@ the same logic runs against both. The reasons are in
The desktop, as the window manager sees it, is two lists and a pointer:
- **Windows**, each a [`WindowInfo`]: its id, process, title, `app_id`, executable, frame,
whether it is minimized, whether it is maximized, whether it is a normal application window
(as opposed to a dialog, a splash screen or a dock), and whether it is alive. A window that
has been destroyed stays in the table for a short time with `alive` false, so that the event
that mentions it can still be logged.
whether it is minimized, whether it is fullscreen, whether it is maximized, whether it is a
normal application window (as opposed to a dialog, a splash screen or a dock), and whether it is
alive. A window that has been destroyed stays in the table for a short time with `alive` false,
so that the event that mentions it can still be logged.
- **Monitors**, each a [`MonitorInfo`]: its id, name, an identity that survives a
hot-plug, its bounds and its work area.
- **The pointer**, a position if the compositor says where it is, and the **focus**, the id
@@ -638,6 +638,14 @@ reported too, and find the workspace as they leave it, so they change nothing. A
already maximized when komorebi starts ([`load_workspace_information`]) or when it opens (a
`Show`) is the maximized window the same way.
A window that goes fullscreen needs no message and no model of its own. The compositor covers the
monitor with it, the bridge reports a `fullscreen` event, and the table keeps
[`WindowInfo::fullscreen`] for the window. The window stays in its container, and the layout keeps
its tile, but [`Window::set_position`], which every move the window manager makes goes through,
does nothing for a fullscreen window, so a retile, a centering or a window that opens moves it
nowhere. A `FullscreenChange` back from fullscreen tiles the workspace again, because KWin gives
the window the frame it had before, which may not be its tile any more.
A workspace is on one of two layers ([`Workspace::layer`]), and the focus, move and resize
messages go to the windows of that layer. `ToggleFloat` puts the workspace on the floating layer,
and putting the window back, or a `FocusChange` to a window that is not floating, a new tiled
@@ -1281,6 +1289,10 @@ the fake. The window manager is its only caller, through [`backend`]. The contra
| A change to a window komorebi does not have is ignored | framework path: [`WindowManager::adopt_maximize_change`] looks the window up in the index of managed windows first | `a_change_for_a_window_komorebi_has_not_taken_in_is_ignored` | none |
| The bridge reports a window as maximized only when KWin has it maximized both ways | test: `isMaximized` in [`bridge.js`] reads KWin's `maximizeMode`, which is 3 for both ways | `bridge.test.js` ("a window maximized one way only is not maximized", "a window the user maximizes or restores is reported, and one maximized one way is not") | none |
| In a real KWin, a window the user maximizes is komorebi's maximized window, the layout does nothing meanwhile, and the window goes back to its tile | VM test | `vm-user-maximize` | none |
| A fullscreen window is never moved | framework path: [`Window::set_position`] returns before the backend when [`WindowInfo::fullscreen`] is set, and every tile, centering and float of the window manager goes through it | `a_fullscreen_window_is_left_covering_the_monitor_and_goes_back_to_its_tile_afterwards`, `a_fullscreen_window_is_not_moved_and_is_again_when_it_is_not_fullscreen` | none |
| A window that leaves fullscreen is put in the tile the layout has for it | framework path: `handle_event` tiles the workspace in front again on a `FullscreenChange` back from fullscreen | `a_fullscreen_window_is_left_covering_the_monitor_and_goes_back_to_its_tile_afterwards` | none |
| The bridge reports a fullscreen change with what the window is now | test: the bridge reads `fullScreen` when KWin raises `fullScreenChanged`, and the table keeps it | `bridge.test.js` ("a window that goes fullscreen or comes back from it is reported as it is now", and the session), `going_fullscreen_and_coming_back_are_events_and_are_remembered` | none |
| In a real KWin, a fullscreen window covers the monitor, a window that opens does not take it out of fullscreen, and it goes back to a tile that overlaps no other | VM test | `vm-features` (section E) | none |
| A window stays maximized through a retile | framework path: [`Workspace::update`] asks the backend to maximize it again, and moves no container | `a_retile_while_a_window_is_maximized_asks_the_compositor_to_maximize_it_again` | none |
| A maximized window that closes takes the maximize with it | framework path: [`Workspace::remove_window`] looks at the maximized window first, which the index of managed windows lists | `a_maximized_window_that_closes_leaves_the_layout_whole` | none |
| In a real KWin, the maximized window fills the work area, is on top, and goes back to its tile | VM test | `vm-features` ("the focused window fills the work area", "and is the one on top", "toggled back, it is in its tile again") | none |
@@ -1574,6 +1586,8 @@ A window is shown, and ends up on a tile:
[`komorebi/tests/user_maximize.rs`](../../komorebi/tests/user_maximize.rs) and
[`komorebi/tests/user_maximize_cases.rs`](../../komorebi/tests/user_maximize_cases.rs), a window
the user maximizes;
[`komorebi/tests/fullscreen.rs`](../../komorebi/tests/fullscreen.rs), a window that goes
fullscreen and comes back;
[`komorebi/tests/manage.rs`](../../komorebi/tests/manage.rs), minimizing, closing,
unmanaging and managing the focused window, and pausing;
[`komorebi/tests/padding.rs`](../../komorebi/tests/padding.rs), the paddings and the work area
@@ -1772,6 +1786,7 @@ A window is shown, and ends up on a tile:
[`Workspace::adopt_maximized_window`]: ../../komorebi/src/workspace.rs
[`WindowManager::adopt_maximize_change`]: ../../komorebi/src/window_manager.rs
[`WindowInfo::maximized`]: ../../komorebi/src/backend/mod.rs
[`WindowInfo::fullscreen`]: ../../komorebi/src/backend/mod.rs
[`load_workspace_information`]: ../../komorebi/src/desktop.rs
[`WindowManager::adjust_workspace_padding`]: ../../komorebi/src/window_manager.rs
[`Workspace::apply_window_based_work_area_offset`]: ../../komorebi/src/workspace.rs
+13
View File
@@ -658,3 +658,16 @@ the layout as `toggle-maximize` makes a window leave it, and what is asked of th
nothing "until it is restored, by `toggle-maximize` or by the user" (the comment in
`process_command`). Because the report is the same either way, one comparison serves both: a window
that is, or is not, already the workspace's maximized window changes nothing.
## Why does komorebi leave a fullscreen window alone, and tile the workspace when it comes back?
Because the window covers the monitor on purpose. The comment in
[`Window::set_position`](../../komorebi/src/window.rs) says that "moving it would take it out of
fullscreen, or be ignored", and that "it goes back to its tile when it leaves fullscreen". The
window stays in its container, so the other windows are tiled as if it were not fullscreen, and
every move the window manager makes goes through `set_position`, which is where the window is
skipped. When the window comes back, "KWin gives it the frame it had before, which may not be the
tile it has now" (the comment in `handle_event`), so the workspace is tiled again. The bridge's
second request for a position gives up after three tries for the same reason: so that a window that
cannot go where it was asked, "a fullscreen one, say", is left alone rather than chased (the comment
on `settle` in [`bridge.js`](../../komorebi/src/kwin/bridge.js)).
+13 -6
View File
@@ -123,12 +123,13 @@ It connects to the session bus as `org.komorebi.Bridge`, writes the bridge to
`$XDG_RUNTIME_DIR/komorebi/bridge.js`, and asks KWin to load it under the name
`komorebi-bridge`, replacing a script of that name left by an earlier run. The script reports
the windows and outputs it finds, and from then on every window that opens, closes, takes the
focus, is minimized or brought back, is maximized or restored, moves or changes size, the start
and the end of every drag of a window by the user, and every change of the outputs (one that
changes resolution or scale, and the room a panel leaves). KWin has no signal for that room, so
the script looks at the outputs again when a dock window opens, closes or moves, and once a
second; it also compares KWin's active window with the one it last reported once a second. The
daemon waits up to 10 seconds for the first report and does not start without it.
focus, is minimized or brought back, goes fullscreen or comes back, is maximized or restored,
moves or changes size, the start and the end of every drag of a window by the user, and every
change of the outputs (one that changes resolution or scale, and the room a panel leaves). KWin
has no signal for that room, so the script looks at the outputs again when a dock window opens,
closes or moves, and once a second; it also compares KWin's active window with the one it last
reported once a second. The daemon waits up to 10 seconds for the first report and does not
start without it.
It also watches for the machine waking up and the screen being unlocked, with two signals that
are not KWin's ([D-Bus](#d-bus)): logind's `PrepareForSleep` on the system bus, and the lock
@@ -173,6 +174,12 @@ shortcut) alike, and the bridge reports a window as maximized only when it is ma
ways (`maximizeMode` 3): a window maximized in one direction is a restored window to komorebi.
The VM test `vm-user-maximize` maximizes windows with `kdotool windowstate`, in both directions,
and passes against KWin 6.8.1 at time of writing (2026-10-27).
A fullscreen window is reported by `fullScreenChanged`, and komorebi asks KWin for no frame for
it while it is fullscreen. When it leaves fullscreen KWin gives it the frame it had before,
whatever komorebi has done to the layout since. The VM test `vm-features` takes a window
fullscreen with `kdotool windowstate`, and checks that it covers the output, that a window that
opens meanwhile leaves it there, and that it is in a tile when it comes back. It passes against
KWin 6.8.1 at time of writing (2026-10-27).
#### When KWin restarts
+2 -2
View File
@@ -121,8 +121,8 @@ the run.
- `Kde.session(machine, scale=)` attaches to the session node's own Plasma
session once its desktop is up, and `shot(name)` returns a screenshot as a
Pillow image, keeping `NAME.png` in the output directory.
- `activate`, `minimize`, `maximize`, `unmaximize` and `close` act on a window through
`kdotool`, as the user would (`maximize` does what the title bar's button does, and the
- `activate`, `minimize`, `maximize`, `unmaximize`, `fullscreen` and `close` act on a window
through `kdotool`, as the user would (`maximize` does what the title bar's button does, and the
daemon is not asked), and `wid_by_class` finds a window by its app id or X11 class.
`Kde.headless(..., xwayland=True)` gives the session XWayland, for X11
clients.