feat(wm): follow a window moved to another output

A window can be moved to another output by something other than komorebi: a KWin
shortcut that sends it to the next screen, the window menu, an application.
komorebi had it in a container of the old monitor, whose tile is on a screen the
window is not on, so it sat untiled where it landed.

The bridge now reports a window's output changing, with the frame the window has
by then, since the signal and the frame arrive in no fixed order, and the table
makes it an OutputChange event. The window manager handles it with
WindowManager::follow_windows_to_their_monitors: every container whose focused
window, and every floating window, is on another monitor than the one it has it
on moves whole to the workspace of the same number on the monitor that holds the
middle of its frame, and the monitors that changed are tiled. Every window is
looked at, not only the one in the event, and a move komorebi made itself is in
its state already and finds nothing to do.

Nothing is followed while the user drags a window: the end of the drag decides
where that window goes, so the method returns at once while a move or a resize
by the user is going on.

KWin also moves windows for a moment after outputs come and go, so the monitor
reconciliator looks again 1.5 seconds after each notification, where it used to
trust what it found at once. vm-hotplug sends windows over with kdotool as well
as with komorebic.
This commit is contained in:
LGUG2Z committed 2026-10-28 07:20:57 -07:00
1 parent f530318cee
commit 40eec2f6be
18 files changed
+825 -62

No files matched your search

+3 -1
View File
@@ -173,7 +173,9 @@ workspace in front of the focused monitor in the area it now has. When an output
is unplugged, KWin takes its windows to the outputs that are left, and the
daemon takes the monitor's containers over to the monitors the windows are on,
tiles them there, and keeps the monitor, with its settings, for when it is
plugged in again.
plugged in again. A window that something else moves to another output (a
shortcut, an application, KWin itself) is followed to the workspace of the same
number on that monitor and tiled there.
The window manager models the desktop as monitors, each with a ring of
workspaces, each with a ring of containers, each with a ring of windows. A