Commit Graph
3112 Commits
Author SHA1 Message Date
LGUG2Z 1e10f45bb9 refactor(config): StaticConfig::read takes &Path, not &PathBuf
clippy::ptr_arg: the function only opens the file, so any path will do, and
every caller that passes a &PathBuf still compiles through deref. Needed so
the macOS StaticConfigExt methods can take &Path (next revision).

Verified: fast-check native, Windows clippy -D warnings, KDE check and lib
tests, macOS fake-CC type-check PASS. Verified on the Mini: not yet.
2026-10-31 12:36:14 -07:00
LGUG2Z a73c9e2131 docs: state of the package migration (steps 0-6), the bar steps, the owed gates
Updates docs/dev/unified-binaries.md: steps 5 and 6 done, the limits found, step 7 for the bar written as
exact steps (B0-B4, not executed; bar files untouched), and the list of heavy builds, VM, e2e and Mac
checks the coordinator owes. Not verified: any nix build.
2026-10-31 12:35:48 -07:00
LGUG2Z 19162f3367 refactor(client): one komorebi-client package that re-exports the daemon of the target OS
The root komorebi-client package (0.1.42) is the one client: src/lib.rs is a cfg_select! over target_os
that re-exports the module of the platform. The three lib.rs files move to komorebi-client/src/{windows,
linux,macos}.rs (they were made equal in socket code by the previous revision), the KDE integration tests to
tests/linux_{daemon,subscribe}.rs (#![cfg(target_os = "linux")]). The daemon crate of each platform has a
dependency key of its own (cargo allows one path per key) and the module names it (use crate::komorebi_linux
as komorebi). The old komorebi-client-linux and komorebi-client-macos packages stay as shims that include
the moved module, so the old names build until the cutover (the macOS bar and komorebic-macos still use
them). komorebic now depends on the one komorebi-client on all three platforms. The KDE and macOS flakes
build the unified client (-p komorebi-client) and take its manifest, lib.rs and their module in the source
filter; the Windows filter leaves the other platforms' modules and tests out. Windows API for komorebi-bar,
komorebi-gui and komorebic is unchanged.

Gates run: Windows clippy --all-targets -D warnings PASS (client, bar, gui, komorebic); KDE cargo test -p
komorebi-client -p komorebi-client-linux -p komorebic -p komorebi-linux: 775 passed 0 failed (the client
tests and doctests included); cargo check of komorebic-linux and komorebi-client-linux PASS; macOS fake-CC
check --locked of komorebi-client, komorebic, komorebi-client-macos, komorebi-bar-macos, komorebic-macos
--all-targets PASS (type check only); CLI docs oracle byte-identical x3; nix evaluation PASS; by evaluation an
edit of komorebi-client/src/windows.rs changes only Windows derivations, linux.rs only kfde, macos.rs
neither. Not run: nix builds, the e2e (komorebi-client is in the closure of komorebi.exe's users: Windows e2e
OWED), any macOS link or run.
2026-10-31 12:34:59 -07:00
LGUG2Z a337eca811 refactor(windows): Window implements WorkspaceWindow
BEHAVIOUR (Windows runtime): none; the four lookups of komorebi-core's
WorkspaceWindow forward to Window's own title, exe, class and path and
nothing calls them through the trait yet. Windows e2e: none needed.

Verified: Windows clippy --workspace --locked --all-targets -D warnings:
PASS. Not run: Windows tests, e2e.
2026-10-31 12:34:57 -07:00
LGUG2Z a05076f491 refactor(kde): Window implements WorkspaceWindow
The four lookups of komorebi-core's WorkspaceWindow forward to Window's
own title, exe, class and path. Nothing calls them through the trait yet.
No behaviour change.

Verified: KDE cargo test -p komorebi --lib --tests (native, lite env):
630 passed, 0 failed. Not run: VM suites.
2026-10-31 12:34:57 -07:00
LGUG2Z b2ba3847cb feat(core): WorkspaceWindow, what a workspace asks of a window
A supertrait of ContainerWindow with the four lookups the shared workspace
code makes (title, exe, class, path, each Option<String>), for the
functions that move into komorebi-core next. The crate's stub window
implements it and a test checks the four answers. Nothing uses it yet.

Verified: cargo test -p komorebi-core --features schemars (native): 16
passed, 0 failed. Not run: the daemons.
2026-10-31 12:32:31 -07:00
LGUG2Z e4d97c87ed refactor(windows): resolve_placement_index uses should_act_window
BEHAVIOUR (Windows runtime, none expected): window.rs gets
should_act_window and should_act_window_individual, thin forms of
should_act and should_act_individual that take one class, and
resolve_placement_index has KDE's text (one let-else over the four
lookups, then those two calls). Same checks in the same order.

Windows e2e scenarios: initial_window_placement rules (target and
rules map, single and many matching rules).

Verified: Windows clippy --workspace --locked --all-targets -D warnings:
PASS. Not run: Windows tests, e2e.
2026-10-31 12:31:37 -07:00
LGUG2Z 259dbb6646 refactor(kde): Window::path is a String and resolve_placement_index uses should_act_window
Groundwork for moving Workspace into komorebi-core. Window::path returns
Option<String>, as the Windows one does (the backend already holds a
String; the PathBuf and the to_string_lossy calls at its seven uses go).
window.rs gets should_act_window and should_act_window_individual, the
one-class forms of should_act and should_act_individual (KDE wraps the
class in a slice), and resolve_placement_index calls those, which is the
text the Windows side gets in the next revision. No behaviour change.

Verified: KDE cargo test -p komorebi --lib --tests (native, lite env):
630 passed, 0 failed. Not run: VM suites.
2026-10-31 12:31:36 -07:00
LGUG2Z e69346e918 refactor(client): the three komorebi-client crates have the same Connection
Windows and macOS had a Connection (messages written a line each in order); KDE had none, and Windows
opened it differently from macOS. All three now have the macOS text (open -> from_stream; KDE's with docs),
and the Windows DATA_DIR is exported like the other two. Additive on KDE and Windows, no change to what
any function does. Preparation for one komorebi-client package; the socket functions were already identical.

Gates run: Windows clippy --all-targets -D warnings PASS (client and its users); KDE cargo test -p
komorebi-client-linux (unit, integration, doctests) PASS. Not run: macOS (file untouched).
2026-10-31 12:24:30 -07:00
LGUG2Z 2b7deddca7 docs: record where the Workspace move stands and what is left, per function
docs/dev/core-model.md section 10: 58 functions (about 530 lines) are now
identical on both sides, only new_container_for_window depends on a
differing function (resolve_placement_index), and a table of every
remaining difference with the converge step or hook that removes it, plus
what ContainerWindow must grow before the first generic function
compiles.

Verified: not applicable (documentation).
2026-10-31 12:22:40 -07:00
LGUG2Z d1539a0687 refactor(komorebic): move the macOS CLI into the unified komorebic package (pure move)
komorebi-for-mac/komorebic/src/main.rs and applications.json move to komorebic/src/macos/{mod.rs,
applications.json}; only the include_str! paths change (they point into komorebi-for-mac/docs) and
main is pub. The old package komorebic-macos stays and builds from the moved file through a shim
(src/main.rs includes ../../../komorebic/src/macos/mod.rs). komorebi-for-mac/komorebic/fixtures stays
where it is: the macOS daemon's pan tests read it. The macOS flake builds komorebic (unified) instead of
komorebic-macos and its source filter takes the unified package's manifest, build.rs, main.rs and
src/macos; the Windows filter already leaves macos out.

Gates run: macOS fake-CC check --locked of -p komorebic and -p komorebic-macos PASS (type check only);
Windows clippy PASS; KDE check PASS; CLI docs oracle byte-identical x3 (the macOS harness reads
komorebic/src/macos/mod.rs now); nix evaluation PASS, and by evaluation an edit of komorebic/src/windows.rs,
linux/mod.rs or macos/mod.rs changes only its own platform's derivations. Not run: nix builds, any macOS
link or run (the user's Mac check: komorebic --help, --version, quickstart, start, stop).
2026-10-31 12:22:20 -07:00
LGUG2Z 63888cb711 refactor(windows): workspace.rs reads window ids and the focus through shared names
BEHAVIOUR (Windows runtime, minor): the same nine functions as on KDE take
PlatformWindowId (isize), read it with window.id(), and use
window::foreground_window_id() / cursor_position() (WindowsApi calls,
moved). One message changes: is_focused_window_monocle_or_maximized
failed with the Win32 error when there is no foreground window and now
says 'no foreground window', as KDE does.

Windows e2e scenarios: focus commands on stacked and monocle windows
(is_focused_window_monocle_or_maximized), float/unfloat of the focused
window, mouse-follows-focus and the click-to-pick-container path
(container_idx_from_current_point).

Verified: Windows clippy --workspace --locked --all-targets -D warnings:
PASS. Not run: Windows tests, e2e.
2026-10-31 12:21:54 -07:00
LGUG2Z cacde3526d refactor(kde): workspace.rs reads window ids and the focus through shared names
Groundwork for moving Workspace into komorebi-core: nine functions of
workspace.rs (contains_window, contains_managed_window,
container_idx_for_window, container_for_window, focus_container_by_window,
remove_floating_window, is_focused_window_monocle_or_maximized,
remove_focused_floating_window, container_idx_from_current_point) take the
id as PlatformWindowId (ContainerWindow::Id), read it with window.id()
(the ContainerWindow method) and ask window::foreground_window_id() and
window::cursor_position() instead of calling backend() inline, which is
exactly the text the Windows side gets in the next revision. The helpers
are KDE's backend calls, moved. No behaviour change.

Verified: KDE cargo test -p komorebi --lib --tests (native, lite env):
630 passed, 0 failed. Not run: VM suites.
2026-10-31 12:21:54 -07:00
LGUG2Z d41cdc8979 refactor(komorebic): move the KDE CLI into the unified komorebic package (pure move)
komorebi-for-kde/komorebic/src/{main.rs,hotkeys.rs,applications.json} and tests/{check,cli,hotkeys}.rs
move to komorebic/src/linux/{mod.rs,hotkeys.rs,applications.json} and komorebic/tests/linux_*.rs
(#![cfg(target_os = "linux")]). The only edits are paths: include_str! and the tests' fixture and
repository-root paths point into komorebi-for-kde/ (docs, komorebi-hotkeys, schema files),
komorebi/tests/asc.rs reads the moved applications.json. The old package komorebic-linux stays and
builds from the moved file through a shim (src/main.rs includes ../../../komorebic/src/linux/mod.rs), so
the old name works until the cutover; its tests now run in the unified package. The KDE flake builds and
tests komorebic (unified) instead of komorebic-linux, its source filter takes the unified package's
manifest, build.rs, main.rs, src/linux and tests/linux_*; the Windows source filter leaves the Linux
and macOS files out. Comments and docs that name komorebic/src/main.rs or komorebic/tests/*.rs
(check.rs, ARCHITECTURE.md, scripts/compare-gen.py, the VM check suite) were not touched: they would
change the KDE derivations for text only.

Gates run: KDE cargo test -p komorebi-linux -p komorebic -p komorebic-linux -p komorebi-client-linux
-p komorebi-hotkeys --no-fail-fast: 888 passed, 0 failed (the moved komorebic tests included); Windows
clippy -D warnings PASS; macOS fake-CC check PASS; fast-check nix evaluation PASS; CLI docs oracle for
kde now generated by the unified komorebic: 166 pages, 0 diff, and its --help first line and --version
equal the old package's. Not run: nix builds (the KDE derivations changed), VM suites. Note: cargo
build/test of both komorebic and komorebic-linux in one command writes the same binary name twice
(use one of them).
2026-10-31 12:19:01 -07:00
LGUG2Z f616e3a1c6 refactor(windows): WorkspaceGlobals is komorebi-core's
komorebi/src/workspace.rs re-exports komorebi_core::WorkspaceGlobals instead
of defining it (crate::workspace::WorkspaceGlobals keeps working for
monitor.rs). Same nine fields, same derives, same schemars derive.

BEHAVIOUR (Windows runtime): none expected, the type is plain data and its
serialisation is skipped in Workspace; marked because it was only
type-checked. Windows e2e scenarios: any that read komorebic state
(tiled, stack, float fixtures) and the schema check.

Verified: Windows cargo clippy --workspace --locked --all-targets -D warnings:
PASS; komorebi-core tests PASS. Not run: Windows tests, e2e.
2026-10-31 12:14:35 -07:00
LGUG2Z 68b661a4ec refactor(kde): WorkspaceGlobals is komorebi-core's
komorebi-for-kde's workspace.rs re-exports komorebi_core::WorkspaceGlobals
instead of defining it (crate::workspace::WorkspaceGlobals keeps working
for monitor.rs and the tests). Same fields, same derives. No behaviour
change.

Verified: KDE cargo test -p komorebi --lib --tests (native, lite env):
630 passed, 0 failed. Not run: doc tests, VM suites.
2026-10-31 12:14:35 -07:00
LGUG2Z 88afd37d36 feat(core): WorkspaceGlobals moves into komorebi-core
The plain data a monitor gives the workspaces it shows (padding, border
width and offset, work area, offsets, floating layer behaviour), moved
from komorebi-for-kde/komorebi/src/workspace.rs (the Windows struct is
the same nine fields with the same derives) into komorebi-core, with the
KDE doc comments and two unit tests. komorebi-core now depends on
komorebi-config (for FloatingLayerBehaviour, default features off) and
komorebi-layouts (for Rect); its schemars feature enables theirs. The
struct derives JsonSchema under the feature, as Windows' did; a workspace
skips the field when serialised and in its schema, so no schema changes.

No daemon uses it yet: the next two revisions converge KDE and Windows.

Verified: cargo test -p komorebi-core --features schemars (native): 15
passed, 0 failed. Not run: the daemons.
2026-10-31 12:14:35 -07:00
LGUG2Z e4a5a03b99 docs: review the Workspace hook design against KDE's update and hide
docs/dev/core-model.md section 9: three corrections to section 8 found by
reading KDE's workspace.rs next to the Windows one (begin_update must be
fallible and mutating because KDE prunes duplicates and clamps the focus
first; end_update must return Pass::Again because Windows' update loops
for scrolling; a scrolling_in_motion condition is read mid-update on both
platforms; adjust_layout is per container for the stackbar), the error
policy of place_window, the orphan-rule cost of extension traits, that
WorkspaceConfig is already shared, that Monitor cannot move before
Workspace (it uses about 25 of its members), the visible-windows decision
for the owner, and the order of what remains.

Verified: not applicable (documentation).
2026-10-31 12:14:35 -07:00
LGUG2Z 2002ca428b docs(core-model): design the platform hooks of a shared Workspace (section 8)
Design only, no code. Section 8 of docs/dev/core-model.md: Workspace<P:
WorkspacePlatform> with defaulted hooks for the six (c) differences of
section 7 (begin_update / adjust_layout / place_window / end_update,
apply_wallpaper, on_window_removed, after_hide, unmaximize_window), what each
platform does in them, the statement that Windows needs no unmaximize in
reintegrate_maximized_window or new_floating_window, how the (d) features
become extension traits or associated state (border_kinds_on_show,
windows_on_show, hwnd_from_exe, custom layouts, the KDE-only reaping and
pruning, scrolling_placed, the Windows-only Monitor fields), what has to
exist first, and the order and e2e gates of the implementation.

Docs only.
2026-10-31 12:14:35 -07:00
LGUG2Z 58c1ac3754 wip 2026-10-31 12:14:35 -07:00
LGUG2Z 839dd2a2de refactor(windows): reintegrate_maximized_window has KDE's error strings and Copy form
"there is no maximized restore index" and "there is no maximized window"
replace the two strings that were copied from the monocle code, and the
as_ref plus deref of the maximized window is dropped (Window is Copy), as on
KDE. Item 7 of the Windows list in core-model.md section 7.

BEHAVIOUR: only the text of two error messages, shown if a command asks to
toggle maximize with nothing maximized. e2e gate: none needed beyond
maximizing. Verified: Windows clippy -D warnings via tools/fast-check PASS.
2026-10-31 12:14:35 -07:00
LGUG2Z 03404aab07 refactor(windows): remove_focused_floating_window is KDE's two lines over a new remove_floating_window
The foreground lookup and the search/removal are split as on KDE:
remove_focused_floating_window(): foreground handle, then
remove_floating_window(window_id). KDE's version also focuses the previous
floating window before removing; the Windows one does not and still does not,
so the split is the only change (the call is the hook the shared code will
make optional). Item 6 of the Windows list in core-model.md section 7.

Not a behaviour change. Verified: Windows clippy -D warnings via
tools/fast-check PASS.
2026-10-31 12:14:35 -07:00
LGUG2Z 07c9ab8fc8 refactor(windows): Window::title, exe, class and path return Option; WindowDetails is infallible
As on KDE. The Win32 error of the four lookups was never told apart: the
callers either turned it into a skip (.ok(), if let Ok, is_ok/is_err), a
default (unwrap_or_default) or a bare ?. They are now Option: .ok() goes,
Ok(..) patterns are Some(..), is_ok/is_err are is_some/is_none, and the
nine places that used ? now say ok_or_eyre("the window has no <field>")?
(IgnoreRule purge, stackbar label, the rule check in process_event, the
workspace-rule title in window_manager). WindowDetails: TryFrom<Window>
becomes From<Window> (unwrap_or_default per field, as KDE), and
visible_window_details pushes every visible window. komorebi-gui and
komorebi-bar adapt (is_some, no .ok()). Items 3 and 4 of the Windows list in
core-model.md section 7.

BEHAVIOUR: (1) komorebic visible-windows now lists a window whose title,
exe or class cannot be read, with empty strings, where it used to skip it;
(2) the error text of the ? sites changes from the Win32 error to "the
window has no <field>". Nothing else changes: the same lookups run in the
same order. e2e gate needed: commands (visible-windows, ignore-rule),
stacking (stackbar labels), lifecycle. Verified: Windows clippy -D warnings
via tools/fast-check PASS (workspace including komorebi-gui and komorebi-bar);
e2e not run.
2026-10-31 12:14:35 -07:00
LGUG2Z 2050b42f00 fix(komorebic): keep the help text of each platform
The unified komorebic package has one Cargo description, and the three CLIs read their about text from
env!("CARGO_PKG_DESCRIPTION"), so the Windows, KDE and macOS help would all have said the same. The text
is a literal in each platform module now, the one the old package had. Verified: see the next revisions
(komorebic --help of the unified Linux binary equals the old komorebic-linux one).
2026-10-31 12:11:41 -07:00
LGUG2Z 5660ad8f02 docs: record the state of the package migration (steps 0-4 done)
Adds the state, the measured cache isolation after the workspace merge and the limits found (stubbed
source is read at evaluation, so other systems' attributes need their own builder; deny/fmt/taplo of the
merged workspace unbuilt; steps 5 and 6 left for the cutover). Not verified: any nix build.
2026-10-31 12:10:04 -07:00
LGUG2Z a72b25dc89 refactor(komorebic): one komorebic package that builds the CLI of the target OS
The root komorebic package (version 0.1.42) is now the one komorebic: src/main.rs is a cfg_select! over
target_os that runs the CLI module of the platform. The Windows main is moved to src/windows.rs
(pub fn main); the Linux and macOS CLIs are included from where they live
(#[path = "../../komorebi-for-kde/komorebic/src/main.rs"], likewise macOS), so no file moves yet and
the old komorebic-linux and komorebic-macos packages still build from the same files. Dependencies are
in per-target tables; cargo allows one path per dependency key, so the Linux and macOS crates keep
their renamed keys and main.rs aliases them (extern crate komorebi_client_linux as komorebi_client).
The unified package needs no reqwest build dependency (committed applications.json) so it builds
natively on Linux without openssl. hotkeys.rs: crate::HOME_DIR -> super::HOME_DIR (same crate root in
the old package).

Gates run: Windows clippy --all-targets -D warnings PASS; KDE check + 294 lib + 5 schemas (old package)
PASS; macOS fake-CC check of -p komorebic --target aarch64-apple-darwin --locked --all-targets PASS (type
check only); native Linux cargo check/build of -p komorebic PASS and its docgen output is byte-identical
to the KDE oracle (166 pages, diff 0); CLI docs oracle byte-identical for windows, macos, kde
(S/step4/regen.sh reads komorebic/src/windows.rs now); nix eval of komorebic and the kfde packages OK.
Not run: nix builds, e2e (komorebic.exe inputs changed: Windows e2e gate OWED), any macOS link or run
(the user must check on a Mac: komorebic --help, --version, start, stop, state, docgen output).
2026-10-31 12:09:39 -07:00
LGUG2Z 80a749b37e build(nix): build the KDE and macOS packages from the root workspace
The three flakes now build from the one root Cargo workspace (previous revision, which must land with
this one). nix/workspace-src.nix assembles each platform's source: the files it needs (its crates, the
root crates they depend on, the root Cargo.toml and Cargo.lock) plus a stub (the member's own
manifest, an empty lib.rs, a main that does nothing) for every other member, because cargo has to load
the whole workspace but must not depend on the other platforms' code. The KDE and macOS flakes pass
-p <their packages> (cargoExtraArgs), no longer cd into a subdirectory workspace, use the root
Cargo.lock/Cargo.toml (vendored from the filtered source, so crane does not read the stubbed one),
and run cargo deny with --workspace --exclude <the other platforms' packages> and their own
deny.toml; the root flake excludes the KDE and macOS packages from deny and builds default-members.
komorebic/applications.json is added to the macOS source filter (it is embedded by include_str!).
The KDE/macOS deny.toml clarify entries and root deny.toml follow the package renames (squashed into
the rename revisions).

Evaluation (nix eval drvPath, no build): Windows clippy, deny, fmt, nextest, toml-fmt; kfde clippy,
doc, deny, fmt, toml-fmt, nextest, schema-fresh; kfde-komorebi, kfde-komorebic, komorebic. Cache
isolation measured by evaluation: an edit of crates/komorebi-bar-core or komorebi/src changes the
Windows drvs and leaves the kfde clippy and nextest drvs unchanged; an edit of komorebi-for-kde changes
kfde and leaves Windows unchanged; an edit of komorebi-for-mac changes neither. tools/kde-closure-check
ok (rewritten for the merged workspace), root-crates.json unchanged.

KNOWN LIMITS: (1) the stubbed source is a derivation that crane reads at evaluation (readDir in
mkDummySrc), so evaluating or building another system's attributes needs a builder for that system:
`nix flake show --all-systems` and drvPath of aarch64-darwin attributes now fail on a Linux host (the
fast-check nix step evaluates the current system only). (2) cargo deny, fmt and taplo behaviour in the
merged workspace is unverified: not built. (3) the version placeholder warning of crane for the
virtual root manifest (cosmetic).

Needs from the coordinator (idle host, heavy gates): nix build -L .#checks.x86_64-linux.komorebi-workspace-clippy
(the root deps derivation is a new one because of the lock), .#checks.x86_64-linux.komorebi-workspace-deny,
-fmt, -nextest, -toml-fmt; the same for kfde-komorebi-workspace-{clippy,deny,fmt,nextest,toml-fmt,doc},
kfde-schema-fresh, .#packages.x86_64-linux.kfde-komorebic and kfde-komorebi; then one KDE VM fast run
(the KDE package derivation changed); on a Mac or a darwin builder: .#packages.aarch64-darwin.kfm-komorebic,
kfm-komorebi, kfm-komorebi-bar and the kfm checks. Not run by me: any of these.
2026-10-31 12:06:27 -07:00
LGUG2Z de45c2f82a refactor(windows): Window::focus, maximize and unmaximize call backend()
As on KDE, the shared-looking operations of Window are the backend calls:
Window::focus(mff) -> eyre::Result<()> is backend().focus(..)?,
Window::maximize() / unmaximize() are let _ = backend().maximize(.., bool).
The Windows primitives they used to be are renamed focus_native,
maximize_native and unmaximize_native; WindowsBackend and the slide-in code
in animation/transition.rs (which is inside the focus) call those. The 40
focus call sites and 5 maximize call sites that spelled
backend().x(WindowId::from_hwnd(w.hwnd), ..) are w.focus(..)? / w.maximize()
again, the text KDE has; the two sites that only have a raw handle
(window_manager.rs, focus_manager.rs) use Window::from(hwnd).focus(..). The
result handling (let _ =) is inside the methods. Item 2 (second half) of the
Windows list in core-model.md section 7.

Not a behaviour change: every call ends in the same backend call as before.
Verified: Windows clippy -D warnings via tools/fast-check PASS.
2026-10-31 11:56:45 -07:00
LGUG2Z f3d4765186 refactor(windows): hide and restore go through ContainerWindow::hide_window / restore_window
The 21 let _ = backend().hide(WindowId::from_hwnd(w.hwnd)) / restore(..)
calls in workspace, monitor, window_manager, process_command and
process_event become w.hide_window() / w.restore_window(), the methods of
komorebi_core::ContainerWindow that the Windows Window already implements
with exactly that backend call. Same text as KDE's window.hide(). Item 2 of
the Windows list in core-model.md section 7.

Not a behaviour change. Verified: Windows clippy -D warnings via
tools/fast-check PASS.
2026-10-31 11:55:47 -07:00
LGUG2Z 846fac7a73 refactor(windows): workspace.rs and monitor.rs name the window id window_id, as KDE does
The parameter and local called hwnd (container_for_window,
focus_container_by_window, contains_window, contains_managed_window,
container_idx_for_window, remove_window, the foreground handle locals) are
renamed window_id; the type stays isize (ContainerWindow::Id) and field
accesses (window.hwnd) are unchanged. Item 1 of the Windows list in
docs/dev/core-model.md section 7.

Not a behaviour change. Verified: Windows clippy -D warnings via
tools/fast-check PASS.
2026-10-31 11:55:08 -07:00
LGUG2Z 3ab6d94e6a refactor(kde): Workspace::hide cannot fail
Class (b) of the workspace.rs classification: Workspace::hide returns
nothing, as the Windows one does; the KDE version returned an eyre::Result
whose doc said it never failed (a failing update of a scrolling workspace is
logged, not returned). The tests that called it drop the ? and unwrap, and
the empty Errors section of its doc goes. No behaviour change.

Verified: KDE cargo test -p komorebi --lib --tests (native, lite env):
630 passed, 0 failed. Not run: doc tests, VM suites.
2026-10-31 11:51:52 -07:00
LGUG2Z 03072f4fdb build(workspace): merge the KDE and macOS crates into the root workspace
komorebi-for-kde/*, komorebi-for-mac/* crates become members of the root Cargo workspace: one
Cargo.lock (901 packages; the 859 Windows entries are unchanged, checked by name and version), the
two nested [workspace] manifests and lock files are deleted, their inherited dependencies are written
out per crate (script S/pkg-merge.py), KDE's .cargo/config.toml (COMMIT_HASH default) moves to the
root .cargo/config.toml (non-forcing, nix still wins). default-members is the Windows set, so a bare
cargo command (and crane, which passes no --workspace) builds only Windows crates; the KDE and macOS
crates are selected with -p. Crates only KDE used were re-resolved newer by cargo; pinned back to the
KDE lock (zbus, zbus_macros 6.1.0, zbus_utils 6.0.0, zruntime 0.2.1, sysinfo 0.40.0). Two small
differences remain: unicode-width 0.2.2 (KDE locked 0.2.3) and libz-sys 1.1.31 (macOS locked 1.1.30).

The root flake and the two nested flakes still read the old workspaces and do not evaluate at this
revision: they are fixed in the next one, which must land with this one (nix cannot be half-merged).
Not behaviour.

Gates run: Windows clippy --all-targets -D warnings (default-members) PASS; KDE check + 294 lib + 5
schemas PASS from the root workspace; macOS fake-CC check of the four macOS packages --locked PASS.
Not run: nix (broken until the next revision), VM, e2e. tools/fast-check now detects the merged
layout.
2026-10-31 11:51:10 -07:00
LGUG2Z 660e67b707 refactor(pkg): rename the Windows daemon package to komorebi-windows
The package name komorebi is needed for the single komorebi binary package (Option A of
docs/dev/unified-binaries.md). The daemon library becomes komorebi-windows with [lib] name and
[[bin]] name unchanged (komorebi); komorebi-client uses package = ...; the version lookup in the
justfile and cargo wix -p in the release workflow follow. Cargo.lock only renames one entry (checked).
Not behaviour: same sources, same binary name.

Gates run: fast-check --since base: Windows clippy PASS, KDE and macOS PASS, nix eval PASS.
tools/e2e-needed lists the e2e binaries as affected (the closure crate's manifest changed), so the
Windows e2e gate is OWED by the coordinator; the produced komorebi.exe should be unchanged code. Not
run: nix builds, e2e.
2026-10-31 11:51:10 -07:00
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 04fbada767 refactor(kde): new_container_for_window takes the Window by value and cannot fail
Class (b) of the workspace.rs classification: Workspace::new_container_for_window(Window)
returns nothing, as the Windows one does; the KDE version took &Window and
returned an eyre::Result that was always Ok. The four callers and the
tests drop the & and the ? or unwrap. No behaviour change.

Verified: KDE cargo test -p komorebi --lib --tests (native, lite env):
630 passed, 0 failed. Not run: doc tests, VM suites.
2026-10-31 11:49:56 -07:00
LGUG2Z eea5a9cb17 refactor(kde): workspace.rs matches maximized windows by value, as Windows does
Class (a) of the workspace.rs classification (docs/dev/core-model.md
section 7): is_focused_window_monocle_or_maximized, contains_window,
contains_managed_window and location_from_exe read the maximized window
with `if let Some(window) = self.maximized_window` (the Window is Copy)
instead of borrowing it, which is the Windows text of those lines. No
behaviour change.

Verified: KDE cargo test -p komorebi --lib --tests (native, lite env):
630 passed, 0 failed. Not run: doc tests, VM suites.
2026-10-31 11:48:04 -07:00
LGUG2Z 3f50f09264 docs: classify the workspace.rs and monitor.rs differences per function
docs/dev/core-model.md section 7: the two files compared function by
function (not by one whole-file diff, which misaligns): 36 non-test
functions of workspace.rs are identical, the differing ones are 1
cosmetic, 15 same-behaviour-different-text, 6 platform differences and 14
one-sided features, with changed-line counts; monitor.rs likewise (8
identical, 2 b, 3 platform, 9 one-sided). Lists what each remaining
cluster needs, as the hand-over to the Windows side.

Verified: not applicable (documentation); the counts come from per-function
diffs of the files at this tip.
2026-10-31 11:42:19 -07:00
LGUG2Z 9432ae487c test(kde): pin the JSON of Monitor and MonitorInformation
Two unit tests in komorebi-for-kde's monitor.rs, the counterpart of the
Windows pins: a Monitor read from the monitor object of a real komorebic
state capture (e2e/lib/tests/fixtures/kfde-tiled.json, workspaces
emptied) serializes back to the same JSON value, and MonitorInformation
has its four fields. They fix the representation before any move of the
Monitor type.

Verified: KDE cargo test -p komorebi --lib monitor:: (native, lite env):
14 passed, 0 failed. Not a behaviour change.
2026-10-31 11:39:36 -07:00
LGUG2Z fdd5e7f8da docs: record that Container moved into komorebi-core and where the move stops
docs/dev/core-model.md section 6: what komorebi-core holds (Container<W>,
ContainerWindow), how KDE and Windows use it, how the JSON is pinned, and
why Monitor is not moved yet: after kfw's convergence the two monitor.rs
still differ by 657 changed code lines (extra Windows fields name,
device_id and workspace_names, serial_number_id Option vs String, the
hmonitor_json id, MonitorInformation fields, the workspace show/hide and
globals methods), which is a decision about the state JSON and a Platform
hook design, not a mechanical converge. Lists what remains in order.

Verified: not applicable (documentation); the 657 comes from diff of the
files stripped of comments and blank lines at this tip.
2026-10-31 11:36:54 -07:00
LGUG2Z 375571d063 refactor(windows): the container is komorebi-core's Container over the Windows Window
BEHAVIOUR (Windows runtime): not verified on a machine; see below.

komorebi/src/container.rs is now `type Container =
komorebi_core::Container<Window>` plus the ContainerWindow impl for the
Windows Window (id is the hwnd, exe_name is Window::exe().ok(), hide and
restore are backend().hide / .restore exactly as the container called
them, and the stacked pair is hide_with_border(false) /
restore_with_border(false) as load_focused_window used). hwnd_from_exe,
which only Windows has, is the ContainerExt trait that workspace.rs
imports. The container's operations, their order and the serialised form
are the ones in the crate (Container.locked keeps its serde default, and
the schemars schema is still named Container). The generic container
tests moved into komorebi-core; the JSON pin and the deserialize tests
stay here. komorebi-core is a path dependency, with its schemars feature
under komorebi's.

Why BEHAVIOUR: the container is the type of every container in the
state JSON and the code of every stack and tile operation, and I could
not run it. By construction the calls are the same, in the same order.
Windows e2e scenarios needed: the tiled, stack and float state
scenarios whose fixtures are e2e/lib/tests/fixtures/kfw-{tiled,stack,
float}.json (komorebic state must be byte-identical), stack/unstack and
cycle-stack commands, a stack on a monitor move, monocle and
move-to-workspace of a stacked container, and the schema check
(schema.json unchanged).

Verified: tools/fast-check windows step = nix develop cargo clippy
--workspace --locked --all-targets -D warnings: PASS (komorebi tests
compiled, not run); komorebi-core tests PASS (native); macOS fake-CC
type-check PASS (it does not use the crate). Not verified: any run of the
Windows tests or daemon.
2026-10-31 11:36:54 -07:00
LGUG2Z 4efd76e9ce refactor(kde): the container is komorebi-core's Container over KDE's Window
komorebi-for-kde/komorebi/src/container.rs is now
`type Container = komorebi_core::Container<Window>` plus the
ContainerWindow impl for KDE's Window (id is the u32 id, exe_name is
Window::exe, the stacked hide and restore are the plain ones). The
operations, their order and the serialised form are the ones moved into
the crate; the tests that need the fake backend and the JSON pin stay
here. komorebi-core is a path dependency of the KDE workspace, and its
schemars feature goes with KDE's.

One difference from before: Container.locked may be missing when a
container is read (serde default), as it already could on Windows; the
JSON written is the same.

Verified: KDE cargo test --workspace --no-fail-fast (native, lite env,
includes tests/schemas.rs): 873 passed, 0 failed (878 before; the 5
container tests that moved into komorebi-core run there, 13 passed).
Not run: KDE VM suites.
2026-10-31 11:36:54 -07:00
LGUG2Z caf24494a7 feat(core): komorebi-core with Container generic over the platform window
New crate crates/komorebi-core, a member of the root workspace (KDE and
macOS take it by path when they adopt it). It holds Container<W>, moved
from komorebi-for-kde/komorebi/src/container.rs (KDE is the base) and
made generic: W is any type that implements ContainerWindow, a small
trait for what the container asks of a platform window (its id, the
executable name, hide and restore, and the hide and restore that
load_focused_window uses, which on Windows leave the border alone).
Container keeps no Backend calls; hiding and restoring is the window's
own business.

The serialised form is unchanged: id, locked (which may be missing when
read, as on Windows), windows with elements and focused. The schemars
schema of Container<W> is named Container whatever W is
(schemars(rename)), so schema.json keeps its definition name; a test
checks it. The tests of container.rs that need no daemon moved with it,
over a stub window, plus tests for the JSON, the hide/restore calls and
the missing locked field.

No daemon uses it yet: the next revisions converge KDE and Windows.

Verified: cargo test -p komorebi-core --features schemars (native):
13 passed, 0 failed. Not run: Windows, KDE, macOS builds (nothing
depends on the crate yet).
2026-10-31 11:36:54 -07:00
LGUG2Z 27b84796e5 test(windows): pin the JSON of Container
Before the container moves into a shared crate: a test that fixes the
serialised form of the Windows Container (id, locked, windows with
elements and focused) for an empty container, next to the existing
deserialize test, so the move cannot change what `komorebic state`
prints.

Verified: not run (Windows tests do not run on Linux); type-checked by
the Windows clippy gate at the end of this stack.
2026-10-31 11:36:54 -07:00
LGUG2Z 2d2dff101c test(kde): pin the JSON of Container
Before the container moves into a shared crate: a test that fixes the
serialised form of komorebi-for-kde's Container, field by field (id,
locked, windows with elements and focused), for an empty container and
for one with two windows, so the move cannot change what `komorebic
state` prints.

Verified: KDE cargo test -p komorebi --lib container (native, lite env):
50 passed, 0 failed. Not run: the rest.
2026-10-31 11:36:47 -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