Commit Graph
2598 Commits
Author SHA1 Message Date
LGUG2Z 1be07fcdd7 refactor(pkg): suffix the KDE and macOS package names (komorebi-linux, komorebic-macos, ...)
The three trees are going to share one Cargo workspace, where package names must be unique. The
KDE packages become komorebi-linux, komorebic-linux, komorebi-client-linux and version-linux, the
macOS ones komorebi-macos, komorebic-macos, komorebi-client-macos, komorebi-bar-macos and
version-macos. Library and binary names do not change ([lib] name, [[bin]] name; dependents use
package = ...), so no source line changes and the binaries are still komorebi, komorebic and
komorebi-bar. Both Cargo.lock files only rename entries (checked: same name/version set otherwise).
The justfiles and the KDE flake (cargoExtraArgs) that name a package are updated here. Not behaviour.

Gates run: fast-check --since base: Windows clippy PASS, KDE check + 294 lib + 5 schemas PASS, macOS
fake-CC check --locked PASS, nix eval of both flakes PASS; KDE cargo test --workspace 879 passed 0
failed (tests/version.rs included); tools/kde-closure-check ok; CLI docs oracle byte-identical for
windows, macos and kde (S/step4/oracle-check.sh, now path-independent and name-aware). Not run: nix
builds, VM suites, e2e. Needed from the coordinator: nothing for the Windows daemon (not renamed
here); the KDE package derivations change name, so one KDE build/VM run will rebuild.
2026-10-31 11:51:10 -07:00
LGUG2Z 4e0a7171ec refactor(cli): name the komorebi and komorebi-bar commands explicitly
clap derives the command name from CARGO_PKG_NAME. The packages are about to be renamed
(komorebi-windows, komorebi-linux, komorebi-macos, komorebi-bar-macos) while the binaries keep
their names, so the name is written in #[clap(name = ...)] on the three daemons and the two bars.
komorebic already names itself in komorebic-core. Not behaviour: the names are the ones the
packages give now. Verified: KDE tests/version.rs is the test that reads the name (run in the
next revisions); fast-check below. Not verified: macOS and Windows runs.
2026-10-31 11:33:02 -07:00
LGUG2Z d6030db53d fix(nix): add komorebi-settings to the KDE source filter list
wip-u-nix narrowed the KDE source to the crates in the KDE cargo closure; the settings stack
(wip-stage) adds crates/komorebi-settings to that closure, so tools/kde-closure-check failed on the
merge of the two. Not behaviour. Verified: tools/kde-closure-check passes. Not verified: nix build.
2026-10-31 11:33:01 -07:00
LGUG2Z e71791399f build(komorebic): commit applications.json instead of fetching it in build.rs
The Windows and macOS komorebic embed applications.json with include_str!, and build.rs
downloaded it when missing (the files were git-ignored). A build script that needs reqwest, and
so openssl on Linux, cannot be part of one package that also builds there, and the download
made nix builds depend on a copy step. The two files are now committed, byte-identical to the
asc flake input (applications.json and applications.mac.json, checked with cmp); the Windows
build.rs keeps only shadow-rs; the macOS build.rs is gone. The flake preBuild copy of the input
file stays and is now a no-op. Not behaviour: same embedded bytes.

Verified: fast-check --since base: Windows clippy PASS, macOS fake-CC check PASS (--locked, so
Cargo.lock unchanged). Not verified: nix builds.
2026-10-31 11:32:40 -07:00
LGUG2Z 12870fa533 chore(repo): base for the package migration
Merge of wip-stage (kfde, bar, settings), wip-cand1 (kfw, kfm), wip-u-nix and wip-u-pkg (the
unified-binaries doc), so the migration is built on the open stacks and does not conflict with them later.
2026-10-31 11:31:14 -07:00
LGUG2Z 374269646e docs: unified komorebi, komorebic and komorebi-bar packages (layout, migration order, risks)
Records the spike (revisions on wip-u-pkg-spike, nothing landed on wip-main): one root
workspace holds the Windows, KDE and macOS crates with one Cargo.lock (+41 packages), the
unified komorebic builds on all three targets, KDE tests pass unchanged except one test
that reads the package name. Recommends komorebic and bar as one crate with cfg(target_os)
modules and the daemon as three gated libraries behind one thin binary, lists the migration
order, risks, gates (compile, S oracle, nix, e2e, KDE VM, Mac hand check) and the file moves
that conflict with the open wip-u-* stacks.

Verified: Windows cargo check -p komorebic, KDE check and 879 of 880 tests, macOS fake-CC
check, all on the spike tree. Not verified: nix builds, e2e, VM, any macOS link or run.
2026-10-31 11:27:53 -07:00
LGUG2Z 1b3b33fb2c chore(repo): combine the kfde, bar and settings stacks (staging)
Staging merge of three stacks that make no runtime change on Windows or KDE: the KDE Backend/Container/process_command refactors (wip-u-kfde), the shared bar core moves (wip-u-bar) and komorebi-settings with the S1/S2 pins (wip-u-settings). Conflicts, if any, are resolved here. Not yet gated: the KDE VM suites and the Windows bar check are owed.
2026-10-31 11:25:59 -07:00
LGUG2Z 495c4f2e0d feat(macos): install the settings handle
New module settings.rs: MacosSettings (empty platform part) and settings(),
a LazyLock<Handle<MacosSettings>> starting from Shared::defaults_for(
PlatformDefaults::MACOS). Nothing reads it yet, so nothing changes at
runtime. A test pins that the starting settings equal the starting values of
the statics (as for KDE); it is type-checked only, because macOS tests
cannot run on this host. Plan step 10, S2. Pure refactor.

Verified: macOS fake-CC cargo check --locked --target aarch64-apple-darwin
--workspace --all-targets: 0 errors. The pin test was not run (no Mac).
2026-10-31 11:25:29 -07:00
LGUG2Z fe2febed56 refactor(macos): take the default constants from komorebi-settings
DEFAULT_RESIZE_DELTA, DEFAULT_MOUSE_FOLLOWS_FOCUS and the initial values of
DEFAULT_WORKSPACE_PADDING and DEFAULT_CONTAINER_PADDING now come from
komorebi_settings::shared (PlatformDefaults::MACOS); the statics keep their
names and types, so no reader changes. Adds the komorebi-settings path
dependency (Cargo.lock +1 package). Plan step 10, S1. Pure refactor: same
values (50, true, 5, 5). BORDER_OFFSET_ADJUSTMENT stays where it is: it is a
macOS-only constant (the platform part, later).

Verified: macOS fake-CC cargo check --target aarch64-apple-darwin
--workspace --all-targets: 0 errors (type-check only; nothing linked or run;
no Mac).
2026-10-31 11:25:29 -07:00
LGUG2Z b7b95320ee feat(kde): install the settings handle
New module settings.rs: KdeSettings (empty platform part) and settings(), a
LazyLock<Handle<KdeSettings>> starting from Shared::defaults_for(
PlatformDefaults::KDE). Nothing reads it yet, so nothing changes at runtime.
A test pins that the starting settings equal the starting values of the
statics (paddings, resize delta, mouse follows focus, border enabled/width/
offset/radius and the six colours), so that S3 and S6 can move each group
over without changing a default. Plan step 10, S2. Pure refactor.

Verified: KDE cargo test -p komorebi --lib --tests (lite env, own target
dir): all test binaries ok, 0 failed, including the new pin. KDE VM suites
not run.
2026-10-31 11:25:29 -07:00
LGUG2Z 3a287fcf0d refactor(kde): take the default constants from komorebi-settings
DEFAULT_RESIZE_DELTA, DEFAULT_MOUSE_FOLLOWS_FOCUS and the initial values of
DEFAULT_WORKSPACE_PADDING and DEFAULT_CONTAINER_PADDING now come from
komorebi_settings::shared (PlatformDefaults::KDE); the statics keep their
names and types, so no reader changes. Adds the komorebi-settings path
dependency (workspace and package manifest, Cargo.lock +1 package).
Plan step 10, S1 (docs/dev/settings.md section 5). Pure refactor: same
values (50, true, 5, 5), pinned by the crate's platform-defaults test.

Verified: KDE cargo test -p komorebi --lib --tests (lite env, own target
dir): all test binaries ok, 0 failed. KDE VM suites not run.
2026-10-31 11:25:29 -07:00
LGUG2Z fb145f96a8 feat(settings): add the shared settings and the load merge
Shared now holds every non-platform setting of docs/dev/settings.md 2.1:
border (enabled, width, offset, radius, six colours), animation (global and
per-prefix enabled, style, duration; fps; Animation::motion_for reading all
three from one snapshot), paddings and constants, transparency, floating
window aspect ratio, layout defaults, display index preferences, with the
per-platform defaults (PlatformDefaults::{WINDOWS, KDE, MACOS}: border 8/10/10
and -1/0/0, padding 10/5/5). SharedDelta::apply reproduces what
StaticConfig::apply_globals does with each key: absent keys keep the old value
(border, paddings, transparency, display preferences, a missing animation
block), absent layout_defaults and floating_window_aspect_ratio reset (the
latter to Standard although the static starts at Widescreen), an animation
block without fps resets fps, a global animation value clears its per-prefix
map and a map replaces the whole map.

No daemon uses the crate yet.

Verified: native cargo test -p komorebi-settings: 18 passed (9 handle, 9
shared: defaults per platform, default colours equal the komorebi-themes
conversion, keep-versus-reset per key, animation merge, motion_for);
clippy clean for the crate. The tests encode what apply_globals does as read
on wip-main; they were not run against the daemons.
2026-10-31 11:25:28 -07:00
LGUG2Z 1fb5e74fe3 feat(settings): add komorebi-settings with the snapshot handle
New crate crates/komorebi-settings (workspace member, Cargo.lock +1
package, no new third-party dependency). Settings<P> is a shared part and a
platform part P; Handle<P> holds the current value as an Arc that readers
snapshot once per unit of work and writers replace through update (writers
serialised, one publish, nothing published if the edit panics). Handle::scoped
sets one field and restores the previous value on drop only if the field
still holds the value it set, replacing the save-and-restore store pairs in
the daemons (Windows WINDOW_HANDLING_BEHAVIOUR, KDE ANIMATION_ENABLED_GLOBAL).
Shared starts with the border and the per-platform defaults; the rest follows
in the next revision. See docs/dev/settings.md.

No daemon uses the crate yet.

Verified: native cargo test -p komorebi-settings: 9 passed (snapshot
isolation, concurrent updates lose nothing, no torn reads under a writer,
scoped restore and 'change made meanwhile wins'); clippy clean for the crate.
komorebi-config warns about an unused import when built without its schemars
feature (not touched here). KDE, macOS and Windows trees not touched.
2026-10-31 11:25:28 -07:00
LGUG2Z 0a823eec94 docs(settings): inventory of the process-wide statics and the Settings design
Measured on wip-main 633e7453 by grep and reading: 126 (Windows), 53 (KDE)
and 74 (macOS) static declarations, of which 61/35/36 are configuration and
51/29/28 are written by apply_globals. The document has the per-static
table (type, writers, readers, shared or platform, matching name), the lock
order of the rule lists, the proposed Settings (shared part plus a platform
type parameter, snapshot reads, serialised updates, scoped override), the
statics whose semantics would change (reload merges rather than replaces;
partial updates visible mid-reload; save-and-restore writes; the empty
WORKSPACE_MATCHING_RULES window), the migration order with pure refactor
versus BEHAVIOUR marks and the gate each needs, and section 7 with the
findings from encoding the semantics in the crate (aspect ratio starts at
Widescreen but a load without the key writes Standard).

Verified: nothing run (documentation); counts from grep, line numbers read
at 633e7453.
2026-10-31 11:25:26 -07:00
LGUG2Z 5002989053 perf(nix): narrow the KDE source to its cargo closure
The KDE source filter took all of crates/, so an edit of
crates/komorebi-bar-core, which KDE does not depend on, changed every KDE
check and VM suite derivation. The filter now takes the nine crates of the
root workspace in the KDE cargo closure, listed in
komorebi-for-kde/nix/root-crates.json (read by the flake and by
tools/kde-closure-check, which fails if the list differs from
`cargo metadata` of the KDE workspace; a new dependency is therefore a
check failure, not a silent skip). The crates/ directory itself still passes
the filter so that its listed members are reached.

Safety: komorebi-gui, komorebi-bar and the e2e crates are already absent
from the KDE source while the root manifest lists them as members, so a
missing member directory is already tolerated. Not proven by a build.

Verified (nix eval of drvPath in a throwaway git copy, 7 commits): an edit
of crates/komorebi-bar-core leaves kfde clippy, nextest, the packages and
kfde-vm.stacks and .commands unchanged (before: all changed); an edit of
crates/komorebi-config changes them; the kfde package still evaluates.
tools/kde-closure-check passes, and fails when a crate is removed from the
list.
2026-10-31 11:22:17 -07:00
LGUG2Z 262f44d2b6 perf(nix): keep the VM library's unit tests out of the suites' source
komorebiVm (the python package every KDE VM suite imports) took all of lib/,
including lib/tests. The VM never runs those tests and setuptools does not
package them, but editing one changed komorebiVm and so rebuilt every suite
(34 of 34, about 50 min of the fast tier). It now takes lib/ minus lib/tests.
libCheck (vm-lib) keeps its own source, so the unit tests still run.

Verified (nix eval of drvPath in a throwaway git copy): an edit of
lib/tests/test_keys.py leaves kfde-vm.stacks and kfde-vm.commands unchanged
(before: both changed). Not verified by a build.
2026-10-31 11:22:15 -07:00
LGUG2Z f861a03adb perf(nix): stamp the commit only into the final Windows package
COMMIT_HASH was in commonArgs, so buildDepsOnly (about 1000 dependencies)
and every check (clippy, nextest, fmt, deny) got a new derivation for every
commit, even a docs-only one, and rebuilt in full.

commonArgs now carries the constant "nix-check" (as the KDE flake already
does) and only fullBuild, and so packages.default and the extracted
binaries, gets the real commit. The e2e build keeps its own constant through
the existing `commit` argument. Nothing the checks compile or test changes;
only the string shadow_rs stamps into the check binaries.

Verified (nix eval of drvPath in a throwaway git copy, 7 commits): the deps
derivation is identical for a docs edit, a Windows source edit, another docs
edit, a bar-core edit and a KDE-crate edit; clippy, nextest and fmt are
unchanged by the docs edit and change only for source edits;
packages.default changes with every commit (real commit embedded). Not
verified by a build: needs one idle-host nix build (commands in
tools/README.md).
2026-10-31 11:22:14 -07:00
LGUG2Z 6a548f4f62 docs: compare the KDE and Windows core model and propose komorebi-core
docs/dev/core-model.md: per-file measured differences between the
Windows, KDE and macOS container, monitor, workspace, window and
window_manager (stripped code lines, changed lines, identical lines),
the platform-specific fields and methods of each layer, a proposed
split into a komorebi-core crate generic over a Platform (Backend plus a
Copy-or-Clone Window and a state type) with the exact order of layers
(container, monitor, workspace, window_manager, router), what the KDE
stack of wip-u-kfde already did, what Windows must do before the crate
can be created, and the list of KDE process_command arms over 20 lines
with the method each became. Measurements are from diff of the files at
this tip; nothing was run on Windows or macOS.

Verified: not applicable (documentation); the numbers were produced by
diff and wc on the files at wip-u-kfde.
2026-10-31 11:09:17 -07:00
LGUG2Z be6cfab24c refactor(kde): query, configuration and border-colour commands are named methods
Plan step 9 prerequisite, last cluster of process_command: Query (51
lines) becomes answer_query(query, reply), ReplaceConfiguration (34)
becomes replace_configuration(config), BorderColour (21) becomes
set_border_colour(kind, r, g, b). After this no arm of KDE's
process_command is longer than 20 lines (the only longer one is the
list of not-supported messages, which has no logic). Bodies are the
arms' bodies, dedented. No behaviour change.

Verified: KDE cargo test -p komorebi --lib --tests (native, FakeBackend):
633 passed, 0 failed. Not run: doc tests, VM suites.
2026-10-31 11:08:13 -07:00
LGUG2Z 65c8e92b05 refactor(kde): rule commands of process_command are named methods
Plan step 9 prerequisite: SessionFloatRule (39 lines), IgnoreRule (55),
NamedWorkspaceRule (21) and InitialNamedWorkspaceRule (21) become
add_session_float_rule(), add_ignore_rule(identifier, id),
add_named_workspace_rule(identifier, id, workspace) and
add_initial_named_workspace_rule(identifier, id, workspace). Bodies are
the arms' bodies, dedented, plus Ok(()). No behaviour change.

Verified: KDE cargo test -p komorebi --lib --tests (native, FakeBackend):
633 passed, 0 failed. Not run: doc tests, VM suites.
2026-10-31 11:05:55 -07:00
LGUG2Z f1ff3d3df8 refactor(kde): resize and layout-ratio commands are named methods
Plan step 9 prerequisite: ResizeWindowAxis (60 lines) becomes
resize_window_axis(axis, sizing), LayoutRatios (23 lines) becomes
set_layout_ratios(columns, rows), and
ToggleWorkspaceWindowContainerBehaviour (21 lines) becomes
toggle_workspace_window_container_behaviour(). Bodies are the arms'
bodies, dedented, plus Ok(()). No behaviour change.

Verified: KDE cargo test -p komorebi --lib --tests (native, FakeBackend):
633 passed, 0 failed. Not run: doc tests, VM suites.
2026-10-31 11:04:02 -07:00
LGUG2Z 54d9f1c8c3 refactor(kde): EagerFocus and ToggleWorkspaceLayer are named methods
Plan step 9 prerequisite, next cluster of process_command: the 75-line
EagerFocus arm becomes WindowManager::eager_focus(exe) and the 90-line
ToggleWorkspaceLayer arm becomes toggle_workspace_layer(). Bodies are
the arms' bodies, dedented, plus Ok(()). No behaviour change.

Verified: KDE cargo test -p komorebi --lib --tests (native, FakeBackend):
633 passed, 0 failed. Not run: doc tests, VM suites.
2026-10-31 11:02:31 -07:00
LGUG2Z 683c1c4b0c refactor(kde): workspace-focus commands of process_command are named methods
Plan step 9 prerequisite: the multi-line arms of process_command become
methods of WindowManager. This cluster: CycleFocusWorkspace
(cycle_focus_workspace), CycleFocusEmptyWorkspace
(cycle_focus_empty_workspace), CloseWorkspace (close_workspace) and the
twin arms MoveContainerToLastWorkspace and SendContainerToLastWorkspace,
which were the same 27 lines but for the follow flag, now one method
move_container_to_last_workspace(follow). The bodies are the arms'
bodies, dedented, plus Ok(()). No behaviour change.

Verified: KDE cargo test -p komorebi --lib --tests (native, FakeBackend):
633 passed, 0 failed. Not run: doc tests, VM suites.
2026-10-31 11:00:21 -07:00
LGUG2Z 1c3221e6b6 docs(bar): status after the config move, merged package layout, macOS hand check
docs/dev/bar-unification.md is brought up to date: what the core holds now
(4,592 lines, the hooks), what is still per platform with fresh
measurements (komorebi.rs 136 differing lines, network.rs 82, bar.rs 444,
main.rs 92, os.rs 71) and why each stays, the known macOS/Windows
differences kept on purpose (including the accept-and-skip of Windows-only
keys, D-coord-1), the proposed layout of the merged package for the
coordinator (module layout with cfg(target_os), dependencies by target,
schema flag, lock-file folding, nix), the ordered plan and the hand check
list. No code changed. The macOS hand-check section for
docs/dev/macos-handcheck.md (owned by kfm, not in this tree) is in the
scratchpad as bar-handcheck-section.md for the coordinator to append.

Verified: figures from diff on this tree. Gates at this tip: native bar-core
tests 3+6, schema harness macOS and Windows byte-identical, Windows clippy
and macOS fake-CC check clean.
2026-10-31 10:57:18 -07:00
LGUG2Z 3603926f0e refactor(kde): order monitor.rs like the Windows monitor
Pure move, no behaviour change: struct Monitor first, then
impl_ring_elements!, then MonitorInformation and its From impl, as in
komorebi/src/monitor.rs. Field order and field sets are untouched (the
derive order is the JSON order of the state, and Windows' extra fields
name, device_id and workspace_names are content, not layout; see
docs/dev/core-model.md).

Verified: KDE cargo test -p komorebi --lib --tests (native): 633 passed,
0 failed. Not run: doc tests, VM suites.
2026-10-31 10:56:57 -07:00
LGUG2Z 91840eb34f refactor(bar-core): move the komorebi layout widget into the core
The two komorebi_layout.rs were identical except for the position of one
`pub use`. The widget moves to
crates/komorebi-bar-core/src/widgets/komorebi_layout.rs together with the
KomorebiLayoutExt trait; the shells re-export the module. Its three
komorebi_client calls go through the platform seam: new hook
`BarPlatform::send_komorebi_message` (next to send_komorebi_batch), which
both os.rs implement as `komorebi_client::send_message`, so each bar sends
exactly what it sent. DefaultLayout and SocketMessage come from
komorebi-layouts and komorebi-protocol (what komorebi_client re-exports).
About 290 lines per bar are gone.

Verified: native bar-core tests 3+6; schema harness macOS and Windows
byte-identical (3,774 / 9,091 lines); Windows clippy -D warnings --locked
clean; macOS fake-CC check --locked 0 errors (files touched first). Not
run: the bars; clicking the layout widget is unverified on both.
2026-10-31 10:56:04 -07:00
LGUG2Z ace81232a5 refactor(kde): container operations have the Windows signatures
Container::add_window takes the Window by value, and hide, restore and
load_focused_window return nothing (hide and restore take &self), as in
komorebi/src/container.rs. The KDE versions returned eyre::Result that
was always Ok (their docs said so) and callers wrote ? or unwrap on it;
those are gone, as is the eyre import of container.rs. Each operation
still does what it did: the same windows are hidden and restored in the
same order. No behaviour change.

Verified: KDE cargo test -p komorebi --lib --tests (native, FakeBackend):
633 passed, 0 failed. Not run: doc tests, VM suites.
2026-10-31 10:55:26 -07:00
LGUG2Z b65a32446e chore(repo): combine the kfw and kfm stacks for the e2e gate
Candidate for the Windows e2e gate: the Windows Backend switches and lock order (wip-u-kfw) with the macOS registry and Window methods (wip-u-kfm). Merge of two independent stacks that both touch crates/komorebi-backend; conflicts, if any, are resolved in this revision.
2026-10-31 10:55:01 -07:00
LGUG2Z ef89899bd9 refactor(bar-core): move config.rs (KomobarConfig and the mouse options) into the core
The (now identical) config.rs of both bars becomes
crates/komorebi-bar-core/src/config/komobar.rs; each shell config.rs is one
line, `pub use komorebi_bar_core::config::*;`. Import edits only: statics
from crate::statics, PathExt/SocketMessage from komorebi-protocol, Rect from
komorebi-layouts, the platform hooks and WidgetConfig as in the core. The
core gains komorebi-themes (KomobarTheme, Colour; schemars forwarded): one
line in each Cargo.lock. About 590 lines per bar are gone.

Because the configuration types are now all in the core, the oracle test
regenerates the macOS schema natively: the macOS view of
`schema_for!(KomobarConfig)` is byte-identical to
komorebi-for-mac/schema.bar.json (new test `generated`). Windows is still
compared by the out-of-tree harness: three descriptions in komorebi-protocol
and komorebi-themes read differently when compiled for Windows, which a
Linux test cannot do.

Verified: native bar-core tests 3 unit + 6 oracle (incl. the generated macOS
view); schema harness macOS and Windows byte-identical (3,774 / 9,091
lines); Windows clippy -D warnings --locked clean; macOS fake-CC check
--locked 0 errors (core files touched first). Not run: the bars.
2026-10-31 10:54:51 -07:00
LGUG2Z afa7fcd219 refactor(mac-bar): converge config.rs onto the Windows source
komorebi-for-mac/komorebi-bar/src/config.rs is now a byte copy of the
Windows one. What that adds on macOS: the `mouse` options (MouseConfig,
MouseMessage, KomorebiMouseMessage), which were commented out; the Windows
spelling of the documentation (10 vs 10.0, the defaults sentence, `50` for
the height default and the root description naming the Windows release),
which the macOS schema view sets back; and one warning at load: a config
that sets `mouse` is accepted and the options are ignored with a logged
warning ("not supported on this platform") on every platform but Windows.

BEHAVIOUR (macOS): a macOS config with `mouse` options used to have them
ignored silently by serde (unknown key); it still ignores them, now with a
warning. The mouse commands cannot run on macOS: exec_shell_command answers
Unsupported and nothing in the macOS bar reads `mouse`.

Verified: schema harness macOS byte-identical (3,774 lines; the view removes
`mouse`, MouseConfig and the SocketMessage closure and resets the text) and
Windows byte-identical (9,091); Windows clippy -D warnings --locked clean;
macOS fake-CC check --locked 0 errors. Not run: the bars. Mac hand check:
start the bar with a config that has a `mouse` block and see the warning.
2026-10-31 10:53:10 -07:00
LGUG2Z 0ec3bc8399 refactor(kde): order container.rs like the Windows container
Pure move, no behaviour change: the impl blocks and methods of
komorebi-for-kde/komorebi/src/container.rs are in the same order as
komorebi/src/container.rs (hide, restore, load_focused_window,
idx_from_exe, contains_window, idx_for_window, remove_window_by_idx,
remove_focused_window, add_window, focus_window), impl_ring_elements!
follows the struct, the derive list and Default::default use the same
spelling. This makes the remaining differences (window id type, fallible
signatures) the only lines a diff shows. See docs/dev/core-model.md.

Verified: KDE cargo test -p komorebi --lib --tests (native): 633 passed,
0 failed. Not run: doc tests, VM suites.
2026-10-31 10:53:02 -07:00
LGUG2Z 7e61c3a934 refactor(bar): reach exec_powershell and send_batch through BarPlatform hooks
The mouse code in config.rs called `crate::bar::exec_powershell` and
`komorebi_client::send_batch` directly, which ties config.rs to the Windows
shell. Two new hooks, `exec_shell_command(&str)` and
`send_komorebi_batch(Vec<SocketMessage>)`, carry them: Windows os.rs calls
exactly `crate::bar::exec_powershell` and `komorebi_client::send_batch`;
macOS os.rs forwards send_batch the same way and answers
exec_shell_command with an Unsupported error (the macOS bar has no shell
session, and its mouse block was commented out), which nothing calls yet.
Windows behaviour is unchanged (same calls); config.rs of Windows now only
depends on the platform seam.

Verified: Windows clippy -D warnings --locked clean; macOS fake-CC check
--locked 0 errors (files touched first). Not run: the bars.
2026-10-31 10:52:09 -07:00
LGUG2Z 4831a6c3ab refactor(bar-core): WidgetConfig with a variant for every widget lives in the core
The widget configuration enum moves to widgets/widget.rs of the core with
all thirteen variants (Keyboard, Media and Systray are no longer cfg-gated
or commented out per tree), plus `supported()`/`unsupported()`/`enabled()`
(enabled is now false for a widget the platform cannot run) and
`warn_unsupported`, which both shells call when they read the config. The
construction of the widget from its config (`as_boxed_bar_widget`, which
needs the runtime types) becomes the extension trait `WidgetConfigExt` in
each shell widget.rs; macOS builds a no-op `Unsupported` for the three
Windows-only widgets, which `enabled()` never lets through.

BEHAVIOUR (macOS), per D-coord-1: a macOS config with a `Keyboard`, `Media`
or `Systray` widget is now accepted and skipped with a logged warning ("the
Keyboard widget is not supported on this platform and is skipped"); before
it failed to deserialize (unknown variant), so the whole bar config was
rejected. Mac hand check: such a config starts the bar and logs the
warning. The macOS schema view removes the three variants from the
schema, so komorebi-for-mac/schema.bar.json and the nix options do not
change.

Verified: schema harness macOS and Windows byte-identical (3,774 / 9,091
lines); native bar-core tests 3+5; Windows clippy -D warnings --locked
clean (re-run after touching the files: Checking komorebi-bar-core and
komorebi-bar); macOS fake-CC check --locked 0 errors. Not run: the bars.
2026-10-31 10:51:02 -07:00
LGUG2Z 42d8ea4656 refactor(kde): remove the Shared wrapper, KDE's Backend extends the shared one
komorebi-for-kde's Backend is now `trait Backend: komorebi_backend::Backend`
and declares only what is KDE's own: drag_origin and drag_end, apply_look,
set_border_colours, set_wallpaper and shutdown. The 26 operations that
have shared names and semantics (docs/dev/seam.md section 2.1) are the
shared trait's; KWinBackend and the KDE FakeBackend implement it directly
(supports() is true for every capability, batches are the default no-ops)
and the backend::shared module with its Shared<B> adapter is deleted. The
shared contract tests (check_all and the KDE-specific assertions) now run
against FakeBackend itself. Integration tests import the shared trait to
call the fake's operations.

No behaviour change. Coverage removed with the duplicated declarations:
the doc examples of the KDE set_opacity and set_focus_follows_mouse
(the fake tests and the shared contract still exercise both) and the
'id too wide for u32' wrapper test (the same rule is in KWinBackend raw()).

Verified: KDE cargo test --workspace --no-fail-fast, 878 passed, 0 failed
(native, FakeBackend; was 881 before this revision, the 3 removed tests
are the ones named above). Not run: KDE VM suites.
2026-10-31 10:50:39 -07:00
LGUG2Z a57648f36d refactor(bar-core): move the network widget config types into the core
NetworkConfig, NetworkSelectConfig, InterfaceDisplayType and
DefaultInterfaceConfig move to widgets/network_config.rs (the macOS file had
the first two without default_interface_options). The union NetworkConfig
therefore also has `default_interface_options` on macOS. The macOS schema
view already removes it from the schema, and serde ignored the key before,
so reading a config is unchanged; the macOS network widget now logs a
warning when the key is set ("not supported on macOS and is ignored").

BEHAVIOUR (macOS): one new log line when `default_interface_options` is
configured; nothing else. Needs no gate beyond the Mac hand check listed in
docs/dev/macos-handcheck.md.

Verified: schema harness macOS and Windows byte-identical (3,774 / 9,091
lines; the macOS view is what removes the field); native bar-core tests
3+5; Windows clippy -D warnings --locked clean; macOS fake-CC check
--locked 0 errors.
2026-10-31 10:48:17 -07:00
LGUG2Z c2e6b01f89 refactor(bar-core): move the komorebi widget config types and KomorebiLayout into the core
The seven Komorebi*Config structs (komorebi.rs) and the KomorebiLayout enum
with its hand-written Deserialize and Display (komorebi_layout.rs) are data:
they move to crates/komorebi-bar-core/src/widgets/komorebi_config.rs, which
needs komorebi-layouts (DefaultLayout; schemars forwarded) and color-eyre
in the core: two lines in each Cargo.lock. The two shells re-export them.
The inherent impl of KomorebiLayout (is_default, on_click, show_icon, show,
the egui painting) cannot stay an inherent impl of a foreign type: it
becomes the extension trait `KomorebiLayoutExt` in each shell with the same
bodies; komorebi.rs imports the trait. Because the types are no longer in
the shell file, the two komorebi_layout.rs differ no more than the Windows
one; the macOS widget files keep their own komorebi.rs runtime.

Verified: schema harness macOS and Windows byte-identical (3,774 / 9,091
lines); native bar-core tests 3+5; Windows clippy -D warnings --locked
clean; macOS fake-CC check --locked 0 errors (core files touched first). I
reverted a stray `cargo fmt --all` that had reformatted unrelated files.
Not run: the bars.
2026-10-31 10:47:01 -07:00
LGUG2Z cb8fc00afb refactor(mac-bar): converge komorebi.rs config text and komorebi_layout.rs onto the Windows source
Schema-text differences only, so that the config types can move into the
core: the macOS KomorebiLayout gets `#[serde(untagged)]` (its Deserialize is
hand-written and nothing in the bar serializes a layout, so no runtime
effect; it only changes the generated schema and the derived Serialize),
`eyre::Result` and `1.0_f32`; KomorebiFocusedContainerConfig::show_icon gets
the Windows `#[deprecated]` and doc (with `#[allow(deprecated)]` at the one
use). The macOS schema view already sets the macOS text of KomorebiLayout
and show_icon back, so komorebi-for-mac/schema.bar.json and
nix/komorebi-bar-options.nix do not change. The coordinator asked to leave
komorebi_layout alone: this was done because the evidence says it is not a
behaviour difference (custom Deserialize, no serialization anywhere in the
macOS bar: `grep to_string|to_value|to_writer` finds none); it is a separate
revision and can be dropped.

Verified: schema harness macOS and Windows byte-identical (3,774 / 9,091
lines); the two komorebi_layout.rs are byte-identical and the config region
of the two komorebi.rs is identical; Windows clippy -D warnings --locked
clean; macOS fake-CC check --locked 0 errors.
2026-10-31 10:43:56 -07:00
LGUG2Z 68d1e49442 refactor(kde): the Backend answers with the shared WindowInfo and MonitorInfo
KDE's Backend returned its own WindowInfo/MonitorInfo (plain String and
bool fields) and the Shared wrapper rebuilt the shared ones from them,
the KDE fake did the reverse. The trait now returns komorebi_backend's
types (Option for what a platform may lack); the fake passes the shared
fake's values through and KWin converts its table's records with From.
The plain KDE structs stay as the view the window manager core reads
(Window::info and the monitor loaders convert with From, which fills a
missing field with empty/false and a missing 'normal' with true, exactly
what KDE always had); the shared wrapper is now a pure pass-through,
removed in the next revision. A few test assertions read the Option
fields. No behaviour change.

Verified: KDE cargo test --workspace --no-fail-fast 881 passed, 0 failed
(native, FakeBackend; the one doc test that needed a fix was re-run
and passes). Not run: KDE VM suites.
2026-10-31 10:43:55 -07:00
LGUG2Z e1820d9bbe refactor(bar-core): move the config types of the Keyboard, Media and Systray widgets into the core
KeyboardConfig, MediaConfig, SystrayConfig, OverflowTogglePosition,
ButtonPosition, FieldMatch and HiddenIconRule (pure data: serde and schemars
derives, no platform code) move from the Windows widget files to
crates/komorebi-bar-core/src/widgets/platform_config.rs, so that the next
revision can give WidgetConfig a variant for every widget. The Windows
widget files re-export them (`pub use`), so no other file changes; the
runtime halves (Win32, systray_util) stay in komorebi-bar. The core gains the
komorebi-config dependency (for MatchingStrategy; the schemars feature now
forwards to komorebi-config and komorebi-protocol); one line in each
Cargo.lock. Nothing on macOS refers to the types yet, so the macOS schema
cannot change. The schema harness (out of tree) no longer slices systray.rs
by line number.

Verified: schema harness macOS and Windows byte-identical (3,774 / 9,091
lines); native bar-core tests 3+5; Windows clippy -D warnings --locked
clean; macOS fake-CC check --locked 0 errors. Not run: the bars.
2026-10-31 10:42:45 -07:00
LGUG2Z a290449763 refactor(bar-core): move the applications widget into komorebi-bar-core
Move of the (now byte-identical) applications.rs of both bars to
crates/komorebi-bar-core/src/widgets/applications.rs. Edits: `PathExt` comes
from komorebi_protocol::pathext (what komorebi_client re-exports; it picks
%VAR% handling by target_os), `ImageIcon` from widgets::icons. The core
gains the komorebi-protocol (default features off) and tracing dependencies:
two lines in each Cargo.lock. Both bars re-export the module. 409 lines per
bar are gone. The schema harness now builds a copy of the core next to its
copy of komorebi-protocol (out of tree).

Verified: schema harness macOS and Windows byte-identical (3,774 / 9,091
lines); native bar-core tests 3+5; Windows clippy -D warnings --locked
clean; macOS fake-CC check --locked 0 errors. Not run: the bars.
2026-10-31 10:40:07 -07:00
LGUG2Z 1bc806c9d9 refactor(bar): converge applications.rs of both bars behind BarPlatform::command_icon
The two applications.rs differed in how an application icon is found for a
command string. The shared file now asks the platform (new hook
`BarPlatform::command_icon(&str) -> Option<ImageIcon>`). Windows os.rs gets
the former `UserCommand::get_executable` logic verbatim (as the private
`executable_of`) and the windows-icons lookup; macOS returns None, exactly
what its commented-out version did. `1.0` vs `1.0_f32` unified. The two
files are now byte-identical. No schema text changes.

Known and preserved: `UserCommand::launch_if_ready` spawns `cmd /C <command>`
in both bars, so launching an application from the macOS bar is broken (it
was before).

Verified: schema harness macOS and Windows byte-identical; Windows clippy
-D warnings --locked clean; macOS fake-CC check --locked 0 errors. Not run:
the bars.
2026-10-31 10:35:25 -07:00
LGUG2Z 292a9ed567 docs(windows): record which call sites go through backend()
docs/dev/backend-switch.md now has the table of what is switched (focus,
set_rect with top = false, frame reads, plain hide/restore, minimize,
close, raise, maximize), what is left in the Windows crate on purpose
(top = true set_position, the *_with_border calls, transition and ghost
machinery, set_opacity: border and animation subsystems are platform-owned,
seam.md rule 5), and, for each query not switched (foreground_window,
cursor_pos, monitors, window, monitor_from_point), what the trait would
need so step 9 can decide.

Docs only.
2026-10-31 10:33:38 -07:00
LGUG2Z 5bffe0e93e refactor(windows): maximize and unmaximize go through backend()
The five window.maximize() / unmaximize() calls in workspace.rs become
let _ = backend().maximize(id, true/false). The trait already has the
capability query (Backend::supports(Capability::Maximize), true on
Windows), so no trait change; the Windows daemon does not need to ask, the
shared core will. WindowsBackend::maximize runs Window::maximize /
unmaximize, which keep the HIDDEN_HWNDS bookkeeping. set_opacity is NOT
switched: the adapter's set_opacity is the plain write, while
Window::transparent/opaque take the alpha from the transparency manager and
animate.

BEHAVIOUR: a dead window is skipped (IsWindow first). e2e gate needed:
maximizing, commands, workspaces. Verified: Windows clippy -D warnings via
tools/fast-check PASS; e2e not run.
2026-10-31 10:32:25 -07:00
LGUG2Z a43d39635b refactor(windows): window_manager.rs reads frames through backend().frame()
Every WindowsApi::window_rect(hwnd) in window_manager.rs becomes
backend().frame(WindowId::from_hwnd(hwnd)). WindowsBackend::frame is
Window::window_rect, i.e. the same DWM call with the Win32 error kept; the
callers' ?, ok(), unwrap_or_default() and is_ok_and() behave as before (only
the error text can differ: a window that died meanwhile reports WindowGone).

BEHAVIOUR: none intended; e2e gate needed: commands, layouts, workspaces, stacking. Verified: Windows clippy
-D warnings via tools/fast-check PASS; e2e not run.
2026-10-31 10:31:13 -07:00
LGUG2Z 63904b736d refactor(windows): border_manager/border.rs reads frames through backend().frame()
Every WindowsApi::window_rect(hwnd) in border_manager/border.rs becomes
backend().frame(WindowId::from_hwnd(hwnd)). WindowsBackend::frame is
Window::window_rect, i.e. the same DWM call with the Win32 error kept; the
callers' ?, ok(), unwrap_or_default() and is_ok_and() behave as before (only
the error text can differ: a window that died meanwhile reports WindowGone).

BEHAVIOUR: none intended; e2e gate needed: borders. Verified: Windows clippy
-D warnings via tools/fast-check PASS; e2e not run.
2026-10-31 10:31:13 -07:00
LGUG2Z d395b0e595 refactor(windows): process_event.rs reads frames through backend().frame()
Every WindowsApi::window_rect(hwnd) in process_event.rs becomes
backend().frame(WindowId::from_hwnd(hwnd)). WindowsBackend::frame is
Window::window_rect, i.e. the same DWM call with the Win32 error kept; the
callers' ?, ok(), unwrap_or_default() and is_ok_and() behave as before (only
the error text can differ: a window that died meanwhile reports WindowGone).

BEHAVIOUR: none intended; e2e gate needed: commands, lifecycle, resize, move. Verified: Windows clippy
-D warnings via tools/fast-check PASS; e2e not run.
2026-10-31 10:31:13 -07:00
LGUG2Z 370dab364a refactor(windows): animation/ghost.rs reads frames through backend().frame()
Every WindowsApi::window_rect(hwnd) in animation/ghost.rs becomes
backend().frame(WindowId::from_hwnd(hwnd)). WindowsBackend::frame is
Window::window_rect, i.e. the same DWM call with the Win32 error kept; the
callers' ?, ok(), unwrap_or_default() and is_ok_and() behave as before (only
the error text can differ: a window that died meanwhile reports WindowGone).

BEHAVIOUR: none intended; e2e gate needed: animation scenarios. Verified: Windows clippy
-D warnings via tools/fast-check PASS; e2e not run.
2026-10-31 10:31:13 -07:00
LGUG2Z 0c197e8652 refactor(bar-core): move ImageIcon, ImageIconId and the icons cache into the core
The icon cache (IconsCache, ICONS_CACHE, ImageIcon, ImageIconId,
rgba_to_color_image) was in widgets/mod.rs of both bars with two small
differences: Windows has `Hwnd(isize)`, `SystrayIcon(String)` and `remove`,
macOS has `WindowId(u32)` and a private rgba_to_color_image. The core file
is the Windows one with the macOS variant and `From<u32>` added (an enum
with every variant, as D26 does for WidgetConfig); both bars re-export the
items from widgets/mod.rs so no widget changes. The core gains the `image`
dependency (one line in each Cargo.lock) and a Default impl for IconsCache
(clippy).

Verified: schema harness macOS and Windows byte-identical (3,774 / 9,091
lines); native bar-core tests 3+5; Windows clippy -D warnings --locked
clean; macOS fake-CC check --locked 0 errors (re-run after touching the core
files). Not run: the bars.
2026-10-31 10:30:21 -07:00
LGUG2Z c700502f15 refactor(windows): border_manager/mod.rs reads frames through backend().frame()
Every WindowsApi::window_rect(hwnd) in border_manager/mod.rs becomes
backend().frame(WindowId::from_hwnd(hwnd)). WindowsBackend::frame is
Window::window_rect, i.e. the same DWM call with the Win32 error kept; the
callers' ?, ok(), unwrap_or_default() and is_ok_and() behave as before (only
the error text can differ: a window that died meanwhile reports WindowGone).

BEHAVIOUR: none intended; e2e gate needed: borders. Verified: Windows clippy
-D warnings via tools/fast-check PASS; e2e not run.
2026-10-31 10:30:21 -07:00
LGUG2Z 74652fb451 refactor(windows): process_command.rs reads frames through backend().frame()
Every WindowsApi::window_rect(hwnd) in process_command.rs becomes
backend().frame(WindowId::from_hwnd(hwnd)). WindowsBackend::frame is
Window::window_rect, i.e. the same DWM call with the Win32 error kept; the
callers' ?, ok(), unwrap_or_default() and is_ok_and() behave as before (only
the error text can differ: a window that died meanwhile reports WindowGone).

BEHAVIOUR: none intended; e2e gate needed: commands, resize. Verified: Windows clippy
-D warnings via tools/fast-check PASS; e2e not run.
2026-10-31 10:30:10 -07:00