The kfm fmt check ran stable `cargo fmt -p ...` on the stubbed workspace
source and failed twice: rustfmt follows the `mod windows;` of the shared
entry files (komorebi-bar, komorebi-client; their windows modules are not in
the macOS source), and the stable rustfmt ignores the nightly options of
this tree's rustfmt.toml. The check is now a runCommand: the nightly rustfmt
(already in the flake for treefmt) with --edition 2024 (the edition of the
macOS manifests; cargo fmt uses it too) and komorebi-for-mac/rustfmt.toml,
over komorebi-for-mac/**/*.rs, komorebic/src/macos, komorebi-bar/src/macos and
komorebi-client/src/macos.rs. The entry files of the shared crates are not
checked; their macos modules are. The macOS code is not clean under it: the
next revision formats it.
Verified: the command reproduced locally with the nightly rustfmt (11 files
differ). The nix attribute is evaluated in the final eval table. Not built.
The rules, rules_class, rules_exe, manage_rules and title_rule e2e scenarios
need a real window to decide WHICH window a rule catches; that decision is the
pure should_act / should_act_individual of the daemon, which no existing test
exercised strategy by strategy (the KDE tests only add a rule or two).
komorebi-for-kde/komorebi/tests/rule_matching.rs adds 13 tests: Equals,
StartsWith, EndsWith, Contains and the four DoesNot* strategies over title,
class, exe and path; each kind reads only its own part of the window; Regex with
and without a compiled regex and over several classes; the .exe suffix of an id
is ignored; no strategy and Legacy keep the old semantics; simple and composite
rules; the last matching rule wins; no rules match nothing; a rule by title
follows the title asked about; an ignore rule keeps a window out and a manage
rule rescues one (through SocketMessage::IgnoreRule / ManageRule and a
FakeBackend desktop). Each test names the e2e check it mirrors.
What stays e2e only: that the daemon evaluates rules when a window opens and not
when it is renamed, that the window then lands on the right workspace and is put
away or shown, and the title, class and exe the real OS reports. The rule
matching exists once per platform (no shared function in komorebi-config), so
this covers the KDE copy only; the Windows and macOS copies stay unproven natively.
Verified: cargo test -p komorebi-linux --test rule_matching in komorebi-for-kde,
13 passed (native, Linux). No source change, no bug found.
The arms CycleMoveContainerToWorkspace, CycleSendContainerToWorkspace,
CycleFocusMonitor, CycleMoveContainerToMonitor, CycleSendContainerToMonitor,
FocusMonitorWorkspaceNumber, MoveContainerToMonitorWorkspaceNumber and
SendContainerToMonitorWorkspaceNumber are one call each of the functions of
komorebi_core::command (their bodies moved there, unchanged), and
WindowManager implements MonitorCommandHost by forwarding to its own methods.
No behaviour change.
Verified: KDE cargo test -p komorebi-linux (lite env): 678 passed, 0 failed.
Not run: VM suites.
Review finding 4 on the stall fix.
- BAR_RUNNING was a process-wide static written by on_message and read by
whichever replace-configuration ran next: a dropped message (paused, lock not
acquired) left a stale answer, and two connections overwrote each other. It
is now a thread_local Cell<Option<bool>>: the per-connection thread that
reads a message (on_message) and then handles it (inside try_lock_for) is the
same thread, every message read replaces the cell (None unless it is a
ReplaceConfiguration), and replace_configuration takes it. TCP clients never
set it and the handler scans for itself, as before.
- The bar section of the config is read before the thread is spawned and its
error is returned to the client as it was (the original read it after a
successful Stop-Process, which cannot fail differently: the same file was read
successfully at the top of the command); only the PowerShell work moves to
the thread (restart_bars takes the bar configuration, no longer a path).
- The restart thread's handle is kept in BAR_RESTART; finish_bar_restart() joins
it and is called before process::exit in WindowManager::stop and in the
ctrl-c path of daemon.rs, and by the next replace-configuration, so komorebic
stop (which stops the bars after the daemon is gone) cannot be followed by a
bar that the restart thread starts late.
BEHAVIOUR: as the earlier revision (the reply no longer waits for the bars), plus
stop now waits for a running restart. Gate needed: Windows e2e commands and
config_reload; manual: replace-configuration then stop with a bar running.
Verified: Windows clippy -D warnings via tools/fast-check PASS; e2e not run.
BEHAVIOUR (registry only). Review finding 3.
process_event returned at 'if self.is_paused' and at the space-id mismatch before
reaching the Destroy arm where forget_pid was, so NSWorkspaceDidTerminateApplication
seen while paused (a locked screen pauses, so does toggle-pause) or on another space
was discarded and the entries of that pid stayed for a process that reuses it.
The forget_pid call is now the first thing process_event does for that
notification, with a comment, and the Destroy arm keeps the rest as it was (the
enhanced-UI forget there is pre-existing and not moved). forget_pid takes only
the registry's own lock: it does not take the window manager lock or dispatch to
the main queue.
Test (Mac): forget_pid removes the windows of that pid and no others.
Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified: any
run; a WindowManager-level test of the paused case needs the process_command.rs
harness and is left to the Mini. Verified on the Mini: not yet. Hand check: H6.
Workspace::remove_floating_window calls the hook before it takes the
window out of the ring (the KDE and macOS originals move the focus to the
previous floating window first, and the focus index moves back by one
whatever the length), but the hook was named after_floating_removed and its
doc said after. Name and doc now say before; the behaviour is the one KDE
and macOS had. KDE's and macOS's implementations are renamed with it (the
only users; Windows keeps the no-op default). A stub test pins the order:
the hook sees both floating windows when one is removed.
Reviewer finding F2 (S/review/core.md). No behaviour change.
Verified: cargo test -p komorebi-core --features schemars (native): 30
passed, 0 failed; KDE cargo test -p komorebi-linux (lite env): 664
passed, 0 failed; Windows clippy --locked --all-targets -D warnings:
PASS; macOS fake-CC check: PASS. Not run: VM suites, Windows e2e.
tests/update_shared.rs (34 tests) over the recording stub: the exact call log
for plain tiling (begin_update, containers_pruned with the old focus index,
adjust_layout then place_container per container, end_update with the around
and viewport arguments, guard dropped last), monocle (place_monocle with the
work area less workspace, container, border offset and border width padding;
no end_update), maximized, monocle beating maximized, scrolling (adopt widths,
scrolling_layouts, hidden flags into place_container, again), empty, tile off,
a skipped begin_update, end_update returning Again (pass numbers, the places
repeated, begin and prune once). Error policy per hook: begin_update,
place_container, place_monocle, maximize_in_layout and end_update errors all
propagate; the guard is still dropped; a failing place_container leaves
latest_layout and the resize vector untouched while a failing end_update has
already kept the layout. Also the layout rules (highest threshold wins and
sticks), container behaviour rules (none reached clears it), work area offset
priority (rule, workspace, monitor; monocle counts as one), the window-based
offset limit, paddings (workspace Some(0) wins over the monitor), resize vector
resizing (not while monocle) and constraint enforcement before layout.
Verified: cargo test -p komorebi-core --test update_shared, 34 passed. No
non-test source changed.
The documents in docs/dev were written at different points of the
consolidation and some of their statements are history (for example
unified-binaries.md still says "never write -p komorebi", true before step 8).
Each now opens with a "Status (wip-cand4)" line saying whether it is design,
evidence or a log, what has landed, what has not, and, for
unified-binaries.md, which part is superseded.
The statuses were taken from the revision list wip-main..wip-cand4 and the
progress log, not from re-measuring. Only the line under the title was added;
no existing text changed. Not built.
Both daemons' window_manager.rs read the focused window's id the same
way: `foreground_window_id()` from their own window.rs (KDE's is the
backend query it already had there; macOS gets the one-line wrapper of
MacosApi::foreground_window_id). The inline `backend().foreground_window()
.and_then(WindowId::to_u32)` chains on KDE and the `MacosApi::` calls on
macOS go, which is the first step to the same text in the two files (the
Windows one is not touched). No behaviour change.
Verified: KDE cargo test -p komorebi-linux (lite env): 664 passed, 0
failed; fake-CC cargo clippy -p komorebi-macos -p komorebic-macos -p
komorebi-client-macos -p komorebi-bar-macos --all-targets -D warnings: PASS
(type-check only). Not run: the macOS tests (the Mac Mini), VM suites.
Plan step 10, S5 for macOS. The seven ANIMATION_* statics are gone. The
Animation, AnimationDuration, AnimationFps and AnimationStyle commands each
write settings().shared.animation with one update (global value clears the
per-prefix map, a prefix inserts one entry); the animation block of a load is
one update through SharedDelta::apply (global clears the map, a map replaces
it, a block without fps has the default, no block keeps everything).
animation::motion_for reads enabled, duration and style from one snapshot
(Animation::motion_for) where it read three separate statics, and
frame_period reads fps from settings. The suspend() counter
(ANIMATIONS_SUSPENDED) is runtime state and stays as it is: it is the model
for the KDE and Windows guards. The test-only AnimationsOn helper in
window_manager.rs writes through settings().
BEHAVIOUR: the animator, lane and border threads no longer see a half-applied
animation reload or command (they can no longer mix the enabled flag of one
configuration with the duration or style of another), and a load publishes the
block once. Gate: macOS hand check (animation section of the hand-check list).
Verified: macOS fake-CC cargo clippy --locked --target aarch64-apple-darwin
-p komorebi-macos --all-targets -- -D warnings: clean. Nothing run on a Mac;
value semantics rest on the settings crate tests (merge, reset of fps, global
clears the map) and the KDE tests that exercise the same delta.
The kfm clippy check failed with: couldn't read
komorebi-for-mac/komorebi/src/../../komorebic/fixtures/pan3-{long,flick,slow}.transcript.txt.
The macOS tests include_str! them, and the source filter drops .txt files
(craneLib.filterCargoSources), as the Windows filter did before its own fix.
The filter now keeps files under a komorebic/fixtures directory.
Verified: the kfm deny drvPath still evaluates (shared source filter); the
clippy attribute needs a darwin builder, so it is not verified here.
The layouts, flipping, layout_flip, padding, tiling and closing e2e scenarios
assert, among other things, that each layout puts one tile per window inside
the work area, none over another, that a flip mirrors the layout and that
container padding shrinks each tile. That is arithmetic of komorebi-layouts and
needs no window manager.
komorebi-layouts/tests/layouts_everywhere.rs runs the eight layouts of the
layouts scenario over three work areas (one off the origin, one with negative
left), 1 to 12 windows and paddings none/0/10/30, and asserts: one tile per
window; inside the area; no overlap; tiles fill the area exactly (all but
grid); fewer windows give a tile at least as big; one window has the area less
padding; padding shrinks every tile; the three flips equal the unflipped tiles
mirrored as a set; a vertical flip only moves tiles up or down. Each test names
the e2e checks it mirrors.
What stays e2e only: that a daemon hands these rectangles to the OS, and that
the OS frames agree (borders, client rounding, timing, the layouts scenario's
wait for the windows to settle).
Verified: cargo test -p komorebi-layouts --test layouts_everywhere, 8 passed
(native, Linux). No source change, no bug found.
Eight arms' worth of the router as functions of komorebi_core::command:
cycle_move_container_to_workspace (the move and the send arm, by follow),
cycle_focus_monitor, cycle_move_container_to_monitor (move and send),
focus_monitor_workspace_number and move_container_to_monitor_workspace_number
(move and send). They need five more operations of the window manager, in
a second trait MonitorCommandHost: CommandHost (mouse_follows_focus,
update_focused_workspace, direction_from_monitor_idx,
move_container_to_monitor, focused_workspace_idx), so the daemons that
implement only the first trait still compile. The text is the KDE text,
which Windows and macOS have byte for byte. tests/commands.rs mirrors the
e2e checks of commands.py: cycle-move-to-workspace and cycle-send-to-workspace,
cycle-monitor (the wrap), cycle-move-to-monitor and cycle-send-to-monitor,
focus-monitor-workspace, move-to-monitor-workspace and
send-to-monitor-workspace.
Verified: cargo test -p komorebi-core --features schemars (native): the
commands test file 14 passed, 0 failed (the rest of the crate unchanged).
Not run: the daemons (nothing calls the functions yet).
Reverts 4bdda86f. A write timeout can deliver a truncated JSON document: part
of the notification is written, the write then fails with TimedOut, and the
subscriber, which stays subscribed, reads the prefix followed by the next
notification. It also does not bound the stall: nothing evicts the subscriber
(each push to it waits another second under the window manager lock), the
connect has no timeout (uds_windows offers none), and that Winsock honours
SO_SNDTIMEO on AF_UNIX sockets is unverified. The transport change and the
Windows connect closure are both reverted, including the skip-on-timeout test
(the connect parameter of notify_sockets was already there and is unchanged).
Follow-up, not done: an eviction policy for a subscriber that does not take a
notification, together with a timeout that was verified on Windows (or a
non-blocking write with a per-subscriber queue). Decision D-coord-10.
Behaviour is back to cand4's predecessor (no timeout). Verified: tools/fast-check
(native, Windows clippy -D warnings) PASS; e2e not needed beyond commands.
BEHAVIOUR (registry only; the reaper notification that Window::drop already
sends is the pre-existing behaviour and is untouched). Review finding 2.
Window::drop runs for every clone, including the one State::from makes of each
window on every command and event notification, and alive() is false for any
failed Accessibility call (a busy or launching app, a modal animation). The
registry forget that the registry revision put there therefore made a
transient failure drop the entry of a live, managed window. It was redundant
with the places that really know a window is gone (reap_window, and forget_pid when
an application quits), so it is removed and a comment says why.
Test (Mac): registering a window and dropping a clone of it leaves the entry.
Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified: any
run. Verified on the Mini: not yet. Hand check: H7, and H3 (kill -STOP an app,
focus around it: its windows must stay managed).
Candidate 4: wip-cand3c (core line with macOS on komorebi-core, HideSpot, settings S1-S3, bar e2e scenario, handover scenario fix), wip-u-core3 (shared Workspace update_shared and the Windows converge of window_manager/process_command), wip-u-stallfix (lock-holder instrumentation, sysinfo scan before the lock, bar restart and hwnd file off the lock, subscriber write timeout) and wip-u-pkg2 (one komorebi package and binary, daemons as libraries). Conflicts, if any, are resolved here.
tests/workspace_layers.rs (33 tests): monocle toggle, reintegration (index
restore, padding past the end), cycling and its wrap; new_floating_window from
a container, a stack, the monocle and the maximized window (unmaximize hook, the
failure leaving the window maximized); floating removal and the
after_floating_removed hook; the layer enum (default, Display, JSON) and that the
shared code never changes it; Workspace::hide order (floating from the back at the
window spot, containers at the display spot, maximized, monocle) with the error
policy: a floating or container window that will not hide is skipped, a maximized
one is an error that stops before the monocle.
tests/resize_constraints.rs (11 tests): the sides each default layout leaves
adjustable for 1..4 containers, None tiles, and no containers.
BUG FOUND (one ignored test): enforce_resize_for_right_vertical_stack indexes
resize_dimensions[1] where its own comment says zero is on the right, so the main
container is never constrained and the second may not be resized at all; this is
inherited unchanged from the Windows tree. The current behaviour is pinned by a
passing test and the intended one by an #[ignore = "bug: ..."] test.
Verified: cargo test -p komorebi-core --test workspace_layers --test
resize_constraints: 33 and 10 passed, 1 ignored. No non-test source changed.
COMPARE.md is a snapshot of kfw 173aa802 and kfm 125a9a5 (2026-10-27), before
the commands, messages and configuration types moved into crates/. Its
generated tables count duplicated definitions that no longer exist, and the
generator cannot read the new layout: running it against this tree
(`--kfw .. --kfm ../komorebi-for-mac --kfde .`) stops with "cannot find
^enum SubCommand" because the command definitions are in crates/komorebic-core.
Rather than regenerate tables that would be wrong, the document gets a STALE
banner naming the snapshot, the reason and where the current description is
(docs/dev/ARCHITECTURE-UNIFIED.md, core-model.md), and the script docstring
says it must be ported or retired. No tables were rewritten.
Verified: ran the script as above (fails as described); the script still
parses. Not built. Executable mode of the script is unchanged.
Plan step 10, S5 for KDE. The seven ANIMATION_* statics are gone. The
Animation, AnimationDuration, AnimationFps and AnimationStyle commands each
write settings().shared.animation with one update (a global value clears that
setting's per-prefix map, a prefix inserts one entry, as before); the
animation block of a load is one update through SharedDelta::apply (a global
value clears the map, a map replaces it, a block without fps has the default,
no block keeps everything); movement_animation and movement_style read one
snapshot (Animation::motion_for).
The seven commands that rearrange a stack (StackWindow, UnstackWindow,
StackAll, UnstackAll, CycleStack, CycleStackIndex, FocusStackWindow) used
ANIMATION_ENABLED_GLOBAL.swap(false) and store(restore), which overwrote a
reload or command that ran in between, and was skipped by an early return.
They now hold settings::animation_off(): Handle::scoped on the global enabled
flag, which puts the previous value back on drop only if the field still holds
false (a change made meanwhile wins, an early return still restores). Same
scope as before: the global flag only, not the per-animation map.
BEHAVIOUR: (1) one publish per load / command; (2) the restore no longer
clobbers a concurrent change; (3) an error return in a stack command now
restores the flag. Gate: KDE VM suites that stack windows (stacks, animation).
Verified: KDE cargo test --locked -p komorebi-linux --lib --tests (lite
env): 58 binaries, 623 passed, 0 failed; the existing tests animation.rs,
animation_config.rs (reload: global versus per-kind, fps default) and
animation_stack.rs (animation back on after each stack command) read through
settings(). VM suites not run.
The first darwin build of the root flake failed in komorebi-workspace-deps:
rustc 1.92.0 is not supported by sysinfo@0.39.6 (requires rustc 1.95).
rust-toolchain.toml says channel = stable, and kfm-rust-overlay was pinned
to 1d3f83ba (January 2026), whose stable is 1.92.0, while the unified lock
now has sysinfo 0.39/0.40 and parking_lot 0.13 (rust-version 1.95, the
highest in the macOS and the KDE closures by cargo metadata).
kfm-rust-overlay (flake.nix, flake.lock, and the pin in
komorebi-for-mac/flake.lock) now uses 19ecdd08, the revision the root
flake's own rust-overlay and kfde-rust-overlay lock; its stable is 1.99.1.
kfm-nixpkgs and every other input are unchanged.
Verified (nix eval of drvPath, throwaway git copy before/after): the
Windows deps, clippy and nextest, and the kfde deps, clippy, nextest and
VM suite stacks are identical; kfm deny, fmt and toml-fmt change (the
toolchain). rust-bin.stable.latest version evaluated: 1.99.1 at the new
rev, 1.92.0 at the old one. Not verified: the darwin clippy, nextest and
deps drvPaths cannot be evaluated on this Linux host (the stub source is a
derivation the host cannot build); no build run.
The four navigation methods of the macOS window manager (the ones that
were already the KDE text) call the functions of komorebi_core::command, the
FocusLastWorkspace arm is `self.focus_last_workspace()` (a new method that
calls the shared function; the macOS arm had the pointer preamble commented
out, which is the host default), and WindowManager implements CommandHost by
forwarding to its own methods. No behaviour change.
Verified: fake-CC cargo clippy -p komorebi-macos -p komorebic-macos -p
komorebi-client-macos -p komorebi-bar-macos --all-targets -D warnings: PASS
(type-check only). Not run: the macOS tests (the Mac Mini).
BEHAVIOUR (what is registered, and when; nothing reads the registry yet
except the unused MacosBackend). Review findings 1 (cost) and 6 (wrong
observer).
Window::new created a fresh AXObserver and registered the window each time,
so one event registered up to three constructions on the event thread under the
window manager lock (the attach-check, the re-check and the managed one), each
replacing the last, and the managed window's attached observer (the one
window.observe put on the run loop) was replaced by the third throwaway's
unattached one; window_by_title at start-up made n x n of them for an
application with n windows. Registration now happens in Window::observe, after
add_observer_to_run_loop succeeded: a Window made only to ask an app something
is never observed and never registered, the registry holds the observer that is
really attached, and a window is registered once (process_event.rs after
should_manage, and macos_api.rs at start-up). The decision is documented in
ax_registry.rs in the docs revision of this stack.
Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified: any
run. Verified on the Mini: not yet. Hand checks: H3 (start-up with a many-window
app: time to ready), H7 (native tabs).
Gate candidate 3c: wip-cand3b (cand3 + the bar e2e scenario) plus wip-u-kdefix (handover precondition in both copies of the shared e2e lib, KDE vm-commands bring_back step). The shared e2e/lib handover scenario is also what the Windows runner runs, so the Windows gate must include it.
notify_subscribers connects to every subscriber socket and write_all()s the
notification with the window manager locked (every command, the reaper and
the event thread), with no timeout: a subscriber that stops reading stalls the
lock holder, and with it every thread.
komorebi_transport::notify_sockets skips a subscriber whose write fails with
TimedOut or WouldBlock (warns, keeps it subscribed, goes on to the next);
every other write error still aborts as before. The timeout itself is the
caller's: the connect closure passed by the Windows daemon sets a 1 s write
timeout on the stream. KDE and macOS pass connect closures without a timeout,
so nothing changes for them. A new unit test covers the skip. The connect
itself cannot be bounded (uds_windows has no connect timeout), and the
listener's lock wait is untouched.
BEHAVIOUR: a Windows subscriber that does not read for a second misses that
notification instead of blocking the daemon. Gate needed: Windows e2e commands
and config_reload, the lock stress, subscriber scenarios if any. Verified:
native cargo test -p komorebi-transport 14 passed (incl. the new test);
tools/fast-check native, Windows clippy -D warnings and KDE check + lib tests
PASS; macOS type-check run by hand (fast-check's macOS step fails to select
a package on this merged tree) PASS. e2e not run.
tests/workspace_containers.rs (41 tests) over the recording stub: where a new
window goes (empty, after the focused container, scrolling hook index,
preselection, every initial placement rule incl. the 1-based index and its
fallback), resize-slot bookkeeping on insert and remove, locked containers
keeping their index on insert, swap and promote, the note_scrolling_departure
hook before a removal, the focus index after remove_container (idx-1 of the
FOCUSED container, not of the removed one), stacking (move_window_to_container)
and unstacking with the exact hide/restore call order and the hide spot passed,
focus by window, window lookup across containers, monocle, maximized and
floating windows, location_from_exe order, visible_windows order, directions
with and without layout flip, cycling and the pointer lookup.
Verified: cargo test -p komorebi-core --test workspace_containers, 41 passed.
No non-test source changed.
The consolidation moved files that the KDE docs and a few comments name,
so about a dozen references were dead or wrong:
- docs/dev/ARCHITECTURE.md: `ring.rs` and `lockable_sequence.rs` are in
crates/komorebi-collections; the daemon `main.rs` is `daemon.rs` of the
komorebi-linux library; the KDE command line is
komorebic/src/linux/mod.rs and hotkeys.rs of the root komorebic package;
the tests that moved are komorebic/tests/linux_{check,cli,hotkeys}.rs,
komorebi-client/tests/linux_subscribe.rs and
komorebi-daemon/tests/linux_{socket,hot_reload}.rs.
- komorebi/src/check.rs (doc comments only), the VM `check` suite and its
library extra, docs/dev/scrolling-next.md: `komorebic/tests/check.rs` and
`cli.rs` are `linux_check.rs` and `linux_cli.rs`.
- CONTRIBUTING.md, Releases: the version is in komorebi/Cargo.toml (the
KDE tree no longer has a workspace manifest).
Text and comments only, no code. The edit of check.rs and of the VM files
changes the KDE derivations (acceptable for docs). Verified: a link checker
over komorebi-for-kde/docs/dev reports no dead relative link; the moved test
files exist and contain the two named test functions. Not built.
Plan step 10, S4. TRANSPARENCY_ENABLED and TRANSPARENCY_ALPHA are no
longer statics: the Transparency and TransparencyAlpha commands and
ToggleTransparency write settings().shared.transparency with one update, the
load applies both keys as one update, the transparency manager reads the flag
and the alpha from one snapshot, and state and the config dump use the
accessors. KDE's load RESETS both keys when absent (false, 200), unlike
Windows which keeps the value; the delta passed to SharedDelta::apply is built
with unwrap_or so that stays exactly as it was. tests/transparency.rs and
transparency_config.rs use settings() (the latter pins the load with and
without the keys).
BEHAVIOUR: (1) ToggleTransparency was a load then a store and is now one
update, so two toggles cannot lose each other; (2) the load publishes both keys
together. Gate: KDE VM suite for transparency/opacity.
Verified: KDE cargo test --locked -p komorebi-linux --lib --tests (lite
env): 58 binaries, 623 passed, 0 failed. VM suites not run.
BEHAVIOUR (Windows runtime): cycle_focus_workspace,
cycle_focus_empty_workspace, close_workspace, move_container_to_last_workspace
and focus_last_workspace of the Windows window manager call the functions of
komorebi_core::command (their bodies are the ones that moved, which are the
KDE text; for these five Windows had the pointer preamble in all of them but
KDE not in three, and the shared functions run it when the host says
POINTER_PICKS_THE_MONITOR_FOR_ALL, which WindowManager does here). It
implements CommandHost by forwarding to its own methods. By construction the
calls and their order are the old ones; marked because it was only
type-checked.
Windows e2e scenarios needed: commands (cycle-workspace,
cycle-empty-workspace, close-workspace, focus-last-workspace,
move-to-last-workspace, send-to-last-workspace) and workspaces, with a second
monitor if the guest has one (the pointer preamble).
Verified: Windows cargo clippy -p komorebi-windows --locked --all-targets -D
warnings: PASS. Not run: Windows tests, e2e.
BEHAVIOUR (cost only; nothing reads the registry yet except the unused
MacosBackend). Review finding 1.
Application::drop does a blocking Accessibility round trip (is_valid ->
copy_attribute_names) when is_observable, and invalidates the observer that
every clone shares if that fails. AxEntry held a clone of the Application, so
every register (which drops the entry it replaces), forget and forget_pid ran
that call, on the event thread with the window manager lock held, and an
unresponsive app made it slow or made it invalidate the observer of a live
app. Window::entry() now stores Application::inert(), a clone with
is_observable false, whose drop does nothing, and Window::from_entry therefore
builds windows with an inert application as well (it only affects Drop).
Tests (run on a Mac; the flag is plain data and needs no Accessibility
permission): a registered entry and a window made from an entry have
is_observable false even when the window's own application is observable.
Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified: any
run. Verified on the Mini: not yet. Hand check: H3 of docs/dev/macos-handcheck.md.
Scenario precondition fix for the vm-commands failure "[shared] win3 is inside the work area and
not on a tile of the layout" (see the previous revision for the log evidence).
The shared sweep sends windows to other workspaces (send-to-last-workspace and the like), so
by the time handover ran, win3 was alone on workspace 0 and win1/win2/win5 were parked on
workspace 3. New KDE step bring_back, between replace_configuration and handover: while another
workspace of the first monitor has windows, focus it and send-to-workspace 0, then focus
workspace 0 and check that it has two containers or more and is the focused one. The handover
check is untouched.
Native pytest of the VM lib: 320 passed; ruff check and format clean. The step itself only runs
in the VM.
VM verification: not yet (vm-commands on baseline-with-fix and candidate, ~20 min each, after the
KDE VM run).
update_known_hwnds (at the end of every command) and the reaper opened,
truncated and wrote komorebi.hwnd.json with the window manager locked. They
now hand the list to reaper::save_known_hwnds, which keeps only the latest
pending list and writes it from a thread of its own; errors are logged there
as before (the reaper no longer returns the write error).
BEHAVIOUR: the file is written a moment after the lock is released, not before
the command returns, and when several updates arrive together only the last
list is written. Nothing in the daemon reads the file. Gate needed: Windows e2e
commands, lifecycle, and the lock stress. Verified: Windows clippy -D warnings
via tools/fast-check PASS; e2e not run.
Adds crates/komorebi-core/tests/common (StubWindow, StubPlatform): a
Clone-but-not-Copy window and a platform whose window operations and every
WorkspacePlatform and MonitorPlatform hook append a line to an ordered log,
with failure injection per operation (fail("hide 3"), fail("place_container")),
scripted end_update passes and a per-workspace hide spot kept in the platform
state the way macOS keeps its corner. The log and settings are thread-local
and every test starts with fresh().
tests/container_behaviour.rs pins Container<W> (24 tests): add/remove/focus
ordering, the focus index after removal at each position (it is idx-1 whatever
was focused, and dangles after an out-of-range removal), empty-container cases,
the order of hide_window calls (from the back, a failing window is skipped),
load_focused_window stopping at the first failure, the omitted window, restore,
locking and the JSON shape.
Verified: cargo test -p komorebi-core --test container_behaviour, 24 passed
(nix shell gcc, own target dir). No non-test source changed.
cycle_focus_workspace, cycle_focus_empty_workspace, close_workspace and
move_container_to_last_workspace of the KDE window manager call the
functions of komorebi_core::command (their bodies moved there, unchanged),
the FocusLastWorkspace arm is `self.focus_last_workspace()`, a new method
that calls the shared function, and WindowManager implements CommandHost by
forwarding to its own methods (KDE keeps the default of the pointer switch:
it does not look at the pointer for the empty, close and last commands).
No behaviour change.
Verified: KDE cargo test -p komorebi-linux (lite env, command_sweep and the
workspace command tests included): 678 passed, 0 failed. Not run: VM
suites.
replace-configuration ran the PowerShell that stops and starts komorebi-bar
(one to three powershell_script::run calls, each seconds) with the window
manager locked. The block is now fn restart_bars and runs on a thread of its
own, started after the new window manager is in place (the lock is released
when the command returns); its errors are printed as before, but no longer
returned to the client.
BEHAVIOUR: the command replies before the bars are restarted (a client that
waited for the bar to exist after replace-configuration must now wait for it),
and an error reading the config for the bar section is printed instead of
returned. Only affects a daemon that has a bar running. Gate needed: Windows
e2e commands and config_reload (no bar in the e2e), a manual check with a bar.
Verified: Windows clippy -D warnings via tools/fast-check PASS; e2e not run.
komorebi-core gets `command`: the workspace navigation commands as
functions generic over a CommandHost (the few window-manager operations
they build on: the monitors and the focused one, the monitor under the
pointer, focus_monitor, focus_workspace, move_container_to_workspace):
cycle_focus_workspace, cycle_focus_empty_workspace, close_workspace,
focus_last_workspace and move_container_to_last_workspace. The text is
KDE's (which is macOS's); the one platform difference, that Windows lets the
pointer pick the monitor first for cycle_focus_empty_workspace,
close_workspace and focus_last_workspace where KDE and macOS do not, is the
associated const CommandHost::POINTER_PICKS_THE_MONITOR_FOR_ALL (false by
default). Nothing uses them yet.
tests/commands.rs implements the host with a recording stub and mirrors the
e2e checks of commands.py (cycle-workspace, cycle-empty-workspace,
close-workspace, focus-last-workspace, move-to-last-workspace and
send-to-last-workspace): wrap-around, the pointer's monitor, which
workspaces close, going back and forth, follow and send, and the Windows
switch.
Verified: cargo test -p komorebi-core --features schemars (native): 30
unit + 9 command tests passed, 0 failed (and the other test files of the
crate). Not run: the daemons (nothing calls the functions yet).
replace-configuration called sysinfo::System::new_all() and refresh_processes
under the window manager lock, only to know whether komorebi-bar.exe runs.
new_all reads memory and CPU (it opens a performance-counter query, slow the
first time), and for every process the command line, environment, owner and
disk usage. The stall analysis measured the first replace-configuration of
each e2e run holding the lock for about 3 s (17 of 17 runs).
Now: komorebi_bar_is_running() reads only the process names
(System::new + refresh_processes_specifics(All, true, nothing())), and the
connection policy runs it in on_message, i.e. before the window manager is
locked for a ReplaceConfiguration, and leaves the answer in a static for the
handler to take (the handler scans itself, names only, if the answer is
missing, e.g. the message came over TCP). The result is the same: whether a
komorebi-bar.exe process exists, now decided when the message is read rather
than after the new window manager is built.
BEHAVIOUR: the lock hold of replace-configuration shrinks (expected from about
3 s to the preload/init/reload cost); a bar started or stopped between the
read of the message and the end of the reload is not noticed. Gate needed:
Windows e2e commands and config_reload, the lock stress, and the sweep timing
(first replace-configuration, see the new per-step info lines). Verified:
Windows clippy -D warnings via tools/fast-check PASS; e2e not run.
Instrumentation for the stalls of the stall analysis; no behaviour change.
lock_holder.rs: a place that has just locked the window manager calls
lock_holder::held("site") and keeps the returned guard next to the lock
guard; the holder (what, thread, since) is recorded in a slot of its own
(a mutex held only for a copy; the window manager lock itself is unchanged),
a hold of 200 ms or more is logged at warn when it ends ("window manager
lock held by X (thread T) for N ms"), and lock_holder::describe() names the
holder for the waiters: the border manager's "stuck for N ms" warning and
the listener's "could not acquire window manager lock" warning now end with
the holder. Sites: every command (held as "command <message>"), process_event,
reaper, monitor reconciliator, border manager, transparency and stackbar
managers. komorebi-transport: ConnectionPolicy::lock_holder() (default None),
used in that warning; the Windows policy implements it, KDE and macOS keep the
text they had.
replace-configuration logs info lines "replace-configuration: <step> took N
ms" for restore, preload, init, restore of the new wm, reload, swap, the
process scan for komorebi-bar and the bar restart; every command logs at
debug how long the command, update_known_hwnds and notify_subscribers took.
Verified: tools/fast-check: native, Windows clippy -D warnings, KDE check +
lib tests PASS; the macOS step of fast-check fails to select a package on this
merged tree (tool issue: -p komorebi), the macOS check run by hand with -p
komorebi-macos -p komorebic-macos -p komorebi-client-macos -p
komorebi-bar-macos passes. Not run: e2e.
Scenario precondition fix; the check "the unmanaged window is inside the work area and not on a
tile of the layout" itself stays as strict as it was.
The KDE VM suite vm-commands failed it on a calm host, on the original komorebi-for-kde tip
(7d19fd40) and on the refactored stage alike, with the same numbers each time: work area
(0,0,1920,1080), layout a single tile (10,10,1900,1060), win3 at (10,10,1896,1050) (within the
24 px tolerance of that tile), win1/win2/win5 parked on workspace 3. After the sweep win3 was the
only window on its workspace. Unmanaging a lone window leaves it on the tile it was put on, and
an emptied workspace has nothing to calculate, so it keeps its last layout; "not on a tile" could
never hold. The scenario now checks first that the focused workspace has at least two tiled
containers and, if not, fails with a message that says so (and the describe() dump) instead of
the misleading unmanage failure. Windows runs handover as its own suite with its three tiled
clients on workspace 0, so the precondition holds there.
The same file lives in e2e/lib and in komorebi-for-kde/nix/tests/vm/lib; both are edited alike. A
fake-platform test covers the precondition; the existing handover cases still fail where they
should.
Native pytest of the VM lib: 320 passed; ruff check and format clean.
VM verification: not yet (vm-commands on baseline-with-fix and candidate, ~20 min each, after the
KDE VM run).
docs/dev/core-model.md section 18: the shared share of window_manager.rs
after the converge (26% identical with Windows, 37% within four lines,
63% differing or one-sided, so not above the 60% bar), a table of the
near-identical functions and why each is cosmetic or real (the Windows
handle_unmanaged_window_behaviour calls in 18 functions against the router
call on KDE and macOS, borders, floating windows in monocle, workspace
names, custom layouts, id types), the 25 differing router arms (two
converged, the rest real; FocusWorkspaceNumber(s) and FocusLastWorkspace
probably an omission on KDE), and the seven blockers.
Verified: not applicable (documentation); numbers from the function
comparison at this tip.
Gate candidate 3b: wip-u-cand3 (macOS on komorebi-core, HideSpot signature change, settings S1-S3) plus the Windows e2e scenario for the bar (wip-u-bar2: e2e/ files and the nix e2e app only). Conflicts, if any, are resolved here.
Merge of kfm's macOS core migration (wip-u-kfm2 9cb4f2fa) and the settings
stack through S3 (wip-u-settings2 696d2929), both on wip-u-integ2. Two files
conflicted, both macOS; every hunk is resolved the same way: take kfm's
version of the file (its new shapes: komorebi_core Monitor/Workspace,
workspace_config and monitor_config as free functions) and re-apply the S3
change to it, because the settings side only touched lines kfm moved.
- komorebi-for-mac/komorebi/src/monitor.rs: conflict 1 (imports): kfm's
header doc kept, the DEFAULT_CONTAINER_PADDING / DEFAULT_WORKSPACE_PADDING
imports dropped (S3). Conflict 2 (std imports): kfm's side (no VecDeque).
The four padding reads (the two default fallbacks in the monitor's
workspace globals) call crate::settings::container_padding() /
workspace_padding(); the now unused Ordering import is removed.
- komorebi-for-mac/komorebi/src/static_config.rs: both conflicts are the
padding defaults in kfm's free functions (workspace_config, monitor_config):
kfm's text kept, the two defaults read from settings. Re-applied S3 in this
file: apply_globals applies paddings, aspect ratio, layout_defaults and
display_index_preferences as one Handle::update of a SharedDelta; the
readers (layout_defaults, aspect ratio, display preferences, paddings) use
the accessors; the statics' imports and the now unused AspectRatio imports
are removed.
komorebi-core and the shared crates read none of the removed statics
(grep: only the unrelated DEFAULT_*_PADDING consts in komorebi-config), so no
hook is needed. S3 semantics are unchanged from wip-u-settings2 (statics
removed, one update per load, reload merges, a few keys reset); the pins
are the settings crate's reload.rs and shared tests plus the KDE
tests/config.rs.
Verified: see the run in the progress log (macOS fake-CC clippy -D warnings
-p komorebi-macos --all-targets clean at this revision).
BEHAVIOUR (log text only, nothing else expected): the Windows copy of
these functions is changed to the text KDE and macOS have where the two
do the same:
- eyre::bail! is written in full (the bail import goes), as in KDE;
- toggle_lock flips the flag through Lockable (set_locked/locked), as
in KDE, instead of assigning the field;
- the log line of maximize_window says 'maximizing window' (it said
'maximizing windowj') and the one of clear_workspace_layout_rules says
'clearing workspace layout rules' (it said 'setting workspace layout');
- the SessionFloatRules arm uses unwrap_or_else and the State arm names
State, which is the text of the KDE arms.
Nothing else of the 61 functions that differ by at most four lines is
the same behaviour: the rest are real differences (core-model.md section
18).
Windows e2e scenarios needed: toggle-lock, maximize, clear layout rules,
session-float-rules, state (all cheap).
Verified: Windows clippy --locked --all-targets -D warnings: PASS (after
touching the sources: the shared target dir had stale metadata). Not
run: Windows tests, e2e.
Step 8 (Option A of docs/dev/unified-binaries.md). The main.rs of komorebi-windows, komorebi-linux and
komorebi-macos becomes daemon.rs of the library (pub fn run; komorebi:: paths are crate:: paths now, the
inner attributes and the unit tests move with it), and their [[bin]] is gone, so each is a library only.
The new package komorebi (komorebi-daemon/, version 0.1.42) is the one binary: its main calls
komorebi_windows::daemon::run, komorebi_linux::daemon::run or komorebi_macos::daemon::run by cfg_select! on
the target OS, through target-gated dependencies (one key per library, cargo allows one path per key),
and forwards the features deadlock_detection and schemars. The binary name komorebi now comes from exactly
one package. The four KDE integration tests that run the binary (no_kwin, socket, hot_reload, version)
move to komorebi-daemon/tests/linux_*.rs; the version test compares with the KDE version crate, since
the package version is now shared. Old names: komorebi-windows, komorebi-linux and komorebi-macos still
build, as libraries (no binary any more: use -p komorebi). The flakes build -p komorebi with the KDE and
macOS packages, the source filters take komorebi-daemon (manifest, main.rs, linux tests), the Windows
filter leaves its linux tests out, deny.toml clarify entries gain komorebi, the release workflow's cargo wix
and the justfile version lookup name komorebi, tools/fast-check checks -p komorebi on KDE and macOS.
Behaviour: the same code runs, the same binary name; the Windows executable is rebuilt from the library
(BEHAVIOUR for the e2e gate: the Windows e2e must run).
Gates run: Windows clippy --all-targets -D warnings PASS; KDE check; macOS fake-CC check of -p komorebi
-p komorebi-macos PASS (type check only); KDE cargo test -p komorebi -p komorebi-linux -p komorebic -p
komorebi-client -p komorebi-hotkeys -p komorebi-core: 903 passed, 0 failed (the four moved tests and the
unit test of daemon.rs included); CLI docs oracle identical x3; bar schema harness identical both bars;
kde-closure-check ok; nix evaluation of the root and both nested flakes PASS; by evaluation an edit of
komorebi/src/daemon.rs changes the Windows derivations only, of the KDE daemon.rs kfde only, of the macOS
one neither (the shared komorebi-daemon/src/main.rs changes all, as expected). Not run: nix builds, VM,
e2e, any Mac run.
New extras scenario e2e/platforms/qemu_windows/extras/bar.py, registered in
run.py as `bar` (runs after the tiling windows, like the other Windows
extras). It starts komorebi-bar in the guest with a configuration that has
storage, time, applications, komorebi workspaces and layout widgets, the
Windows-only Keyboard and Systray widgets and a `mouse` block (a message and
a command), and checks: `komorebi-bar --schema` equals the checked-in
schema.bar.json byte for byte; the process starts and its window titled
komorebi-bar appears, visible and sized; it runs 15 s (scaled); `komorebic
state` answers and komorebi does not tile the bar; commands that notify the
bar work; the bar survives `komorebic stop` and the daemon starting again as
the same process (it reconnects: it does NOT exit when the daemon stops, so
the task text "exits cleanly when komorebi stops" is checked as
`komorebic stop --bar` ending daemon and bar); screenshots are kept as
artefacts, no pixel assertions. No known failures.
Plumbing: run.py uploads komorebi-bar.exe when the binaries directory has it
(other scenarios do not need it, so older build-ref directories still work),
the nix app copies it and sets KOMOREBI_E2E_BAR_SCHEMA to the checked-in
schema (the e2e directory alone does not contain it), build-ref.sh builds it.
README and docs/dev/bar-e2e.md document it.
Verified: py_compile and ruff clean; the runner and library unit tests: 157
passed; flake.nix parses. NOT run: the scenario itself (the Windows guest is
reserved for gates), so every check is untested against a real bar and may
need adjusting (window title, timings, the Systray widget inside the VM).
Needs gate: win-e2e `bar`.
Records the HideSpot change and the three macOS layers (container, workspace,
monitor) as done, lists the functions that stay in the macOS extension traits,
and notes that ContainerExt is the old container code kept for the daemon's own
call sites.
Verified: documentation only.
Section 9 of docs/dev/settings.md: what S3 moved, how apply_globals and the
command write it, how readers get it, and that the only BEHAVIOUR is the
single publish.
Verified: not applicable (documentation).
docs/dev/core-model.md section 16: update_shared and where it departs from
section 12, and what macOS's update keeps (SkyLight batch, no maximized
branch, a separate scrolling path, an unconditional clamp, no stackbar) as
three decisions for its owner. Section 17: process_command arm by arm (110
of 155 arms in all three daemons identical, 45 not, with the clusters of
the differing ones), process_event (only three of the events exist on all
three, so it is the thin-events step), and window_manager function by
function (39 identical in all three, 48 differing, the one-sided lists,
the 20 functions that are identical in KDE and macOS and old only in
Windows), with the order and the hooks of the remaining layers of step 9.
Verified: not applicable (documentation); the counts come from the arm and
function comparison of the three trees at this tip.