mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-27 10:52:52 +01:00
feat(wm): tile what the backend reports
With the model in place, the window manager can do its job: load the desktop from the backend, tile it, and keep it tiled as the compositor reports what happens to windows. The events are the Windows implementation's, each about one window and carrying it: a window is shown, destroyed, given the focus, minimized or restored. A new window gets a container of its own after the focused one, a closed one leaves whichever workspace has it, a window the user minimizes is out of the layout until it is restored, and every event ends with the workspace in front tiled again. At startup every monitor is loaded, and every open window that is normal, alive and not minimized goes on the monitor its middle is on. An index from each managed window to its monitor and workspace is rebuilt around every event, so that the first event komorebi sees can be the close of a window it picked up at startup. Whether a window is managed is, for now, only whether the compositor calls it a normal window and it is alive; the rules that ignore, manage or float applications come later. When a window closes, komorebi leaves the choice of the next focus to KWin unless KWin focuses nothing, so the two do not fight. The daemon runs this against a backend chosen on the command line. --fake-backend, an in-memory desktop with one monitor, is the only one, and without it komorebi exits with a usage error instead of pretending to manage a desktop it cannot reach.
This commit is contained in:
1 parent
c0345eb0e9
commit
02231d232c
16 files changed
+1469
-13
No files matched your search
@@ -50,3 +50,11 @@ window ended up. A backend keeps a table that the compositor's events update, so
|
||||
is a lookup. The trade-off is that the table can be a moment behind the compositor, which
|
||||
is why a command returns when it has been accepted and not when the client has acted, and
|
||||
why the frame a window really has is read back afterwards.
|
||||
|
||||
## Why does komorebi not pick the next window to focus when one closes?
|
||||
|
||||
Because the compositor already has. When a window is destroyed, KWin activates the window
|
||||
it considers next and reports that as a focus change, which komorebi follows. If komorebi
|
||||
also focused a window of its own choosing, the two would fight over the focus. komorebi
|
||||
focuses the window of its focused container only when the compositor has left nothing
|
||||
focused.
|
||||
Reference in new issue
Block a user