From 1fe07c6736b9759cef30431da5162d7911e3fd28 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 31 Oct 2026 23:52:41 -0700 Subject: [PATCH 1/4] fix(nix): pass --config before check in the KDE deny check The KDE deny check failed with `error: unexpected argument '--config' found`: the flake wrote `cargo deny ... check --config bans licenses sources`, and in cargo-deny 0.20.2 (the one of the pinned kfde-nixpkgs) --config is an option of `cargo deny` itself, not of `check`. It now goes into cargoDenyExtraArgs, before `check`. Verified: cargo deny 0.20.2 from nixpkgs f05535a0 (the flake's pin) with the flake's --exclude list, `--config komorebi-for-kde/deny.toml check bans licenses sources`: bans ok, licenses ok, sources ok (the clarify entries and the komorebi-bar-core exclusion of the previous fix are enough, also for komorebi-daemon, komorebi-settings and the wgpu stack). Not built in nix. --- komorebi-for-kde/flake.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/komorebi-for-kde/flake.nix b/komorebi-for-kde/flake.nix index a1c4fc83..59bf0df4 100644 --- a/komorebi-for-kde/flake.nix +++ b/komorebi-for-kde/flake.nix @@ -387,8 +387,10 @@ "komorebi-client-macos" "komorebi-bar-macos" "version-macos" - ]; - cargoDenyChecks = "--config ${platformDir}/deny.toml bans licenses sources"; + ] + # --config is an option of `cargo deny`, not of `check`, in the cargo-deny of this flake's nixpkgs + + " --config ${platformDir}/deny.toml"; + cargoDenyChecks = "bans licenses sources"; } ); From 161ed77f4d7287a9f41d300fbdd27d2296f772e7 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 31 Oct 2026 23:53:18 -0700 Subject: [PATCH 2/4] docs(kde): fix the intra-doc links that cargo doc -D warnings rejects The kfde doc check failed (rustdoc exit 101) on eleven links: Backend::hide, restore, cursor_pos, set_rect, focus, center_cursor_in, current_workspaces and window_workspace are not items of the trait Backend that the links resolve to here, [`Window`] and [`TRANSPARENCY_ALPHA`] are not in scope in their modules, and the public Workspace alias links to the private WorkspaceScrolling. The brackets are removed (the names stay as code), and the two link definitions in desktop.rs. Documentation text only, no code change. Verified: RUSTDOCFLAGS='-D warnings' cargo doc --locked -p komorebi -p komorebi-linux -p komorebic -p komorebi-client -p komorebi-hotkeys --no-deps (the flake's package set) finishes without errors, before it reproduced exactly these eleven; local stable rustc is 1.99.1, the toolchain of the flake. --- komorebi-for-kde/komorebi/src/desktop.rs | 7 ++----- komorebi-for-kde/komorebi/src/kwin/mod.rs | 10 +++++----- komorebi-for-kde/komorebi/src/monitor.rs | 2 +- komorebi-for-kde/komorebi/src/transparency_manager.rs | 2 +- komorebi-for-kde/komorebi/src/workspace.rs | 2 +- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/komorebi-for-kde/komorebi/src/desktop.rs b/komorebi-for-kde/komorebi/src/desktop.rs index 261efe5f..d92701b2 100644 --- a/komorebi-for-kde/komorebi/src/desktop.rs +++ b/komorebi-for-kde/komorebi/src/desktop.rs @@ -286,8 +286,8 @@ pub fn update_monitor_work_areas(wm: &mut WindowManager) -> eyre::Result<()> { /// are on, so that starting komorebi tiles what is on screen. /// /// Each monitor is first focused on the workspace the compositor shows on it -/// ([`Backend::current_workspaces`]). A window is on the monitor whose bounds contain its middle, -/// and on the workspace whose desktop it is on ([`Backend::window_workspace`]), which need not be +/// (`Backend::current_workspaces`). A window is on the monitor whose bounds contain its middle, +/// and on the workspace whose desktop it is on (`Backend::window_workspace`), which need not be /// the one in front; a window on every desktop goes to the one in front. The monitor gets as many /// workspaces as that takes. A window that is minimized, that komorebi does not manage /// ([`Window::should_manage`]: not a normal window, or one the rules ignore), or that is on no @@ -295,9 +295,6 @@ pub fn update_monitor_work_areas(wm: &mut WindowManager) -> eyre::Result<()> { /// ([`Workspace::adopt_maximized_window`](crate::workspace::Workspace::adopt_maximized_window)), not /// a container. Nothing is moved: tiling is [`WindowManager::retile_all`]'s job. /// -/// [`Backend::current_workspaces`]: crate::backend::Backend::current_workspaces -/// [`Backend::window_workspace`]: crate::backend::Backend::window_workspace -/// /// # Errors /// /// This never returns an error: a window that cannot be placed is skipped. diff --git a/komorebi-for-kde/komorebi/src/kwin/mod.rs b/komorebi-for-kde/komorebi/src/kwin/mod.rs index 468b7b7b..d06e6d25 100644 --- a/komorebi-for-kde/komorebi/src/kwin/mod.rs +++ b/komorebi-for-kde/komorebi/src/kwin/mod.rs @@ -52,8 +52,8 @@ //! When something other than komorebi does either, the script reports it, and the table turns it //! into a [`WorkspaceChange`] or a [`WorkspaceMove`] for the window manager to follow. //! -//! Hiding a window ([`Backend::hide`]) moves it to one more desktop, `komorebi-park`, that nobody -//! looks at and that is not a workspace; [`Backend::restore`] moves it back to the desktop of its +//! Hiding a window (`Backend::hide`) moves it to one more desktop, `komorebi-park`, that nobody +//! looks at and that is not a workspace; `Backend::restore` moves it back to the desktop of its //! workspace. KWin saves its desktops in `kwinrc` as soon as one is made, so a desktop that //! komorebi made and did not remove would be there for every later session: komorebi removes it //! when it stops, and one that an earlier run left (it was killed, or the session was torn down @@ -304,12 +304,12 @@ impl Poll { /// The desktop of a running KWin, read and changed through the script komorebi loads into it. /// /// The queries are answered from a [`state::Table`] that the script's events keep up to date, so -/// they do not wait for KWin, except [`Backend::cursor_pos`]: only the script can read the pointer, +/// they do not wait for KWin, except `Backend::cursor_pos`: only the script can read the pointer, /// so it is asked, and given 250 ms to answer. The table also keeps the frame a window had when the /// user began to drag it, for [`Backend::drag_origin`], and the frame the user asked for when they /// let go of an edge of it, for [`Backend::drag_end`]. /// -/// A command ([`Backend::set_rect`], [`Backend::focus`] and the rest) is queued for the script and +/// A command (`Backend::set_rect`, `Backend::focus` and the rest) is queued for the script and /// returns: the script gets the queue as the answer to its held `Poll` call, and carries the /// commands out in order. Commands queued within a millisecond of each other go out as one batch, /// so a retile reaches KWin at once. A command is an error when the table does not know the @@ -318,7 +318,7 @@ impl Poll { /// /// The script cannot move the pointer, so the pointer follows the focus through KWin's own "Move /// Mouse to Focus" action, over `kglobalaccel`: it lands in the middle of the window KWin has -/// focused, whatever rectangle [`Backend::center_cursor_in`] is given. A KWin without global +/// focused, whatever rectangle `Backend::center_cursor_in` is given. A KWin without global /// shortcuts leaves the pointer where it is. /// /// It is made by [`connect`]. diff --git a/komorebi-for-kde/komorebi/src/monitor.rs b/komorebi-for-kde/komorebi/src/monitor.rs index 44d052bb..fade41a6 100644 --- a/komorebi-for-kde/komorebi/src/monitor.rs +++ b/komorebi-for-kde/komorebi/src/monitor.rs @@ -34,7 +34,7 @@ use serde::Deserialize; use serde::Serialize; use std::sync::atomic::Ordering; -/// The monitor over KDE's [`Window`], which is `komorebi_core::Monitor` with this platform's methods +/// The monitor over KDE's `Window`, which is `komorebi_core::Monitor` with this platform's methods /// added by [`MonitorExt`] pub type Monitor = komorebi_core::Monitor; diff --git a/komorebi-for-kde/komorebi/src/transparency_manager.rs b/komorebi-for-kde/komorebi/src/transparency_manager.rs index 7e6f2ffe..97bcce78 100644 --- a/komorebi-for-kde/komorebi/src/transparency_manager.rs +++ b/komorebi-for-kde/komorebi/src/transparency_manager.rs @@ -98,7 +98,7 @@ pub fn transparent_windows(wm: &WindowManager) -> Vec { /// /// The backend is told only what differs from what it was last told, which the window manager /// keeps in [`WindowManager::opacity_applied`]: windows that should not be see-through any more -/// are made opaque, and the others are given [`TRANSPARENCY_ALPHA`]. With transparency off, every +/// are made opaque, and the others are given `TRANSPARENCY_ALPHA`. With transparency off, every /// window is opaque. A failure is logged. pub fn apply(wm: &mut WindowManager) { // one snapshot, so the flag and the alpha are from the same configuration diff --git a/komorebi-for-kde/komorebi/src/workspace.rs b/komorebi-for-kde/komorebi/src/workspace.rs index 751aea0d..01f42e1a 100644 --- a/komorebi-for-kde/komorebi/src/workspace.rs +++ b/komorebi-for-kde/komorebi/src/workspace.rs @@ -43,7 +43,7 @@ pub use komorebi_core::WorkspaceWindowLocation; pub(crate) use komorebi_core::sorted_layout_options_rules; /// The workspace over KDE's [`Window`], which is `komorebi_core::Workspace` with this platform's -/// methods added by [`WorkspaceExt`] and the scrolling ones of [`WorkspaceScrolling`] +/// methods added by [`WorkspaceExt`] and the scrolling ones of `WorkspaceScrolling` pub type Workspace = komorebi_core::Workspace; /// What only KDE keeps in a workspace From 87f34317d072aa2c501e966d696cc4cd1c373d1e Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 31 Oct 2026 23:55:32 -0700 Subject: [PATCH 3/4] style(kde): format the two KDE manifests with taplo Pure formatting, no other change: taplo fmt (default configuration) of komorebi-for-kde/komorebi/Cargo.toml and komorebi-for-kde/komorebic/Cargo.toml, the two files the kfde toml-fmt check reported. The earlier taplo sweep covered the Windows and macOS sources only. Verified: taplo fmt --check over the check's file set (the root Cargo.toml, every .toml of komorebi-for-kde and of the nine to eleven root crates in komorebi-for-kde/nix/root-crates.json) passes, it failed on exactly these two. These two manifests change the KDE derivations (deps included, once); the Windows and macOS ones do not read them. --- komorebi-for-kde/komorebi/Cargo.toml | 18 ++++++++++++++---- komorebi-for-kde/komorebic/Cargo.toml | 4 +++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/komorebi-for-kde/komorebi/Cargo.toml b/komorebi-for-kde/komorebi/Cargo.toml index 1d8d0bb1..86c059c7 100644 --- a/komorebi-for-kde/komorebi/Cargo.toml +++ b/komorebi-for-kde/komorebi/Cargo.toml @@ -12,9 +12,13 @@ komorebi-collections = { path = "../../crates/komorebi-collections" } komorebi-core = { path = "../../crates/komorebi-core" } komorebi-layouts = { path = "../../komorebi-layouts", features = ["schemars"] } komorebi-scrolling = { path = "../../komorebi-scrolling" } -komorebi-config = { path = "../../crates/komorebi-config", default-features = false, features = ["schemars"] } +komorebi-config = { path = "../../crates/komorebi-config", default-features = false, features = [ + "schemars", +] } komorebi-settings = { path = "../../crates/komorebi-settings" } -komorebi-protocol = { path = "../../crates/komorebi-protocol", default-features = false, features = ["schemars"] } +komorebi-protocol = { path = "../../crates/komorebi-protocol", default-features = false, features = [ + "schemars", +] } komorebi-transport = { path = "../../crates/komorebi-transport" } version = { package = "version-linux", path = "../version" } @@ -32,7 +36,9 @@ pastey = { version = "0.2" } regex = "1" schemars = { version = "1.1", optional = true } serde = { version = "1", features = ["derive"] } -serde_json = { package = "serde_json_lenient", version = "0.2", features = ["preserve_order"] } +serde_json = { package = "serde_json_lenient", version = "0.2", features = [ + "preserve_order", +] } serde_with = { version = "3", features = ["schemars_1"] } strum = { version = "0.28", features = ["derive"] } tokio = { version = "1", features = [ @@ -57,7 +63,11 @@ uuid = { version = "1", features = ["v4"] } [features] default = ["schemars"] deadlock_detection = ["parking_lot/deadlock_detection"] -schemars = ["dep:schemars", "komorebi-collections/schemars", "komorebi-core/schemars"] +schemars = [ + "dep:schemars", + "komorebi-collections/schemars", + "komorebi-core/schemars", +] [lib] name = "komorebi" diff --git a/komorebi-for-kde/komorebic/Cargo.toml b/komorebi-for-kde/komorebic/Cargo.toml index e4b52128..8d228f58 100644 --- a/komorebi-for-kde/komorebic/Cargo.toml +++ b/komorebi-for-kde/komorebic/Cargo.toml @@ -5,7 +5,9 @@ description = "The command-line interface for Komorebi, a tiling window manager edition = "2024" [dependencies] -komorebi-config = { path = "../../crates/komorebi-config", default-features = false, features = ["schemars"] } +komorebi-config = { path = "../../crates/komorebi-config", default-features = false, features = [ + "schemars", +] } komorebi = { package = "komorebi-linux", path = "../komorebi", default-features = false } komorebi-client = { package = "komorebi-client-linux", path = "../komorebi-client", default-features = false } komorebi-hotkeys = { path = "../komorebi-hotkeys" } From 2544012c2eaeab872055145ed7b30c349152994a Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 31 Oct 2026 23:55:49 -0700 Subject: [PATCH 4/4] fix(nix): check the KDE formatting file by file with the flake's nightly rustfmt The kfde fmt check ran `cargo fmt -p ...` and failed with `failed to resolve mod windows` for komorebic and komorebi-client: rustfmt follows the cfg_select! branches of the shared entry files into files the KDE source does not have. It is now a runCommand running tools/format-all --tree kde with the rustfmt of the flake's own nightly (fmtToolchain, the toolchain craneLibFmt already used) over komorebi-for-kde/**/*.rs and the linux modules of the shared crates, file by file with skip_children and komorebi-for-kde/rustfmt.toml. tools/format-all now takes the rustfmt of the root dev shell first (the same pinned nightly) before a nightly on PATH, because a different nightly may format differently or not follow cfg_select. Verified: with the rustfmt of that very nightly (rust-overlay 19ecdd08, rustfmt 1.11.0-nightly 2026-10-27, built from the flake's pins) tools/format-all --check passes for kde, mac and windows on this tree, so the only failure was the module resolution, not different formatting. The nix attribute evaluates; not built. --- komorebi-for-kde/flake.nix | 20 ++++++++++++++------ tools/format-all | 20 +++++++++++++------- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/komorebi-for-kde/flake.nix b/komorebi-for-kde/flake.nix index 59bf0df4..112c91b2 100644 --- a/komorebi-for-kde/flake.nix +++ b/komorebi-for-kde/flake.nix @@ -53,9 +53,8 @@ toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; craneLib = (crane.mkLib pkgs).overrideToolchain toolchain; # rustfmt.toml uses options only a nightly rustfmt knows - craneLibFmt = (crane.mkLib pkgs).overrideToolchain ( - pkgs.rust-bin.nightly.latest.minimal.override { extensions = [ "rustfmt" ]; } - ); + fmtToolchain = pkgs.rust-bin.nightly.latest.minimal.override { extensions = [ "rustfmt" ]; }; + craneLibFmt = (crane.mkLib pkgs).overrideToolchain fmtToolchain; # the repository, cut down to this workspace and the crates of the root workspace it depends # on by path (komorebi-layouts and what they depend on, komorebi-themes), with the root @@ -208,6 +207,7 @@ inherit craneLib craneLibFmt + fmtToolchain src real workspaceArgs @@ -339,9 +339,17 @@ }; checks = { - komorebi-workspace-fmt = build.craneLibFmt.cargoFmt ( - build.workspaceArgs // { inherit (build) src; cargoExtraArgs = build.packages; } - ); + # tools/format-all --tree kde: the nightly rustfmt over the files of this tree, file by file. `cargo fmt` + # followed `mod windows;` of the shared entry files into files this source does not have. + komorebi-workspace-fmt = + pkgs.runCommand "komorebi-workspace-fmt" + { + nativeBuildInputs = [ build.fmtToolchain ]; + } + '' + RUSTFMT=rustfmt bash ${builtins.path { path = repoRoot + "/tools/format-all"; name = "format-all"; }} --check --tree kde --root ${build.real} + touch $out + ''; komorebi-workspace-clippy = build.craneLib.cargoClippy ( build.individualCrateArgs diff --git a/tools/format-all b/tools/format-all index 79127f6a..3a6f2228 100755 --- a/tools/format-all +++ b/tools/format-all @@ -15,10 +15,13 @@ # shared crates belong to the kde and mac trees # mac komorebi-for-mac/**/*.rs and the macos modules of the shared crates, with # komorebi-for-mac/rustfmt.toml -# kde `cargo fmt -p `, as komorebi-for-kde/flake.nix does -# The nightly rustfmt is $RUSTFMT if set, else `rustfmt` if that is a nightly, else the one of the -# dev shell of the root flake (`nix develop`), which is the one the nix checks use (a nightly of the -# pinned rust-overlay; another nightly may format a little differently). +# kde komorebi-for-kde/**/*.rs and the linux modules of the shared crates, with +# komorebi-for-kde/rustfmt.toml (the same file-by-file invocation as the mac one; the nix +# check runs this script with the rustfmt of the flake's own nightly, fmtToolchain) +# The nightly rustfmt is $RUSTFMT if set, else the one of the dev shell of the root flake (`nix develop`), +# which is the nightly of the pinned rust-overlay that the nix checks use (the flake of each tree pins the +# same revision; another nightly may format differently and may not follow cfg_select), else a nightly +# `rustfmt` on PATH. set -uo pipefail orig_args=("$@") @@ -39,10 +42,12 @@ done root=$(cd "$root" && pwd) if [ -z "${RUSTFMT:-}" ]; then - if rustfmt --version 2>/dev/null | grep -q nightly; then + if [ -n "${FORMAT_ALL_IN_SHELL:-}" ]; then RUSTFMT=rustfmt - elif [ -z "${FORMAT_ALL_IN_SHELL:-}" ] && command -v nix >/dev/null; then + elif command -v nix >/dev/null; then FORMAT_ALL_IN_SHELL=1 exec nix develop "$root" --command "$0" "${orig_args[@]}" --root "$root" + elif rustfmt --version 2>/dev/null | grep -q nightly; then + RUSTFMT=rustfmt else echo "format-all: no nightly rustfmt (set RUSTFMT)" >&2; exit 2 fi @@ -77,6 +82,7 @@ if [ "$tree" = mac ] || [ "$tree" = all ]; then fi if [ "$tree" = kde ] || [ "$tree" = all ]; then echo "format-all: kde" - cargo fmt -p komorebi -p komorebi-linux -p komorebic -p komorebi-client -p komorebi-hotkeys -- $flag || status=1 + { rs_files | grep '^komorebi-for-kde/'; rs_files | grep -E "^(komorebic/src/linux|komorebic/tests/linux_|komorebi-client/src/linux\.rs|komorebi-client/tests/linux_)"; } \ + | run_rustfmt komorebi-for-kde/rustfmt.toml || status=1 fi exit $status