← Commit history

1.0.42: 1.0.42: two switches the user can flip from the dashboard, both applied at once with no restart. backgroundGuard (default on) is the A/B switch John asked for: off means the bridge never pushes or moves any KiCad window, and the focus log still records what it WOULD have done (guard OFF: would have pushed this window) so the two modes can be compared. activityIndicator finally does something in the native build: Windows flashes a taskbar button orange whenever an app asks for the foreground and is refused or is sent behind right after taking it, which is every KiCad window the bridge opens in the background; progress and none now cancel that flash on bridge-owned windows (about once a second and right after a push), flash and both leave it. The Python build did this; the port dropped it, so the setting was dead from 1.0.0 (John: whackamole). Still not ported: the taskbar progress bar and the Adom overlay badge (wiki #113).

John Lauer ·d337d1a3cc ·1mo ago ·parent 93270fa
4 files changed +22−6
rust/Cargo.lock+3−3
@@ -244,7 +244,7 @@ dependencies = [  [[package]] name = "kicad-bridge"-version = "1.0.41"+version = "1.0.42" dependencies = [  "kicad-core",  "kicad-platform",@@ -255,7 +255,7 @@ dependencies = [  [[package]] name = "kicad-core"-version = "1.0.41"+version = "1.0.42" dependencies = [  "kicad-ipc-rs",  "kicad-platform",@@ -281,7 +281,7 @@ dependencies = [  [[package]] name = "kicad-platform"-version = "1.0.41"+version = "1.0.42" dependencies = [  "serde",  "serde_json",
rust/Cargo.toml+1−1
@@ -3,7 +3,7 @@ resolver = "2" members = ["crates/*"]  [workspace.package]-version = "1.0.41"+version = "1.0.42" edition = "2021" license = "MIT" publish = false
rust/crates/kicad-bridge/src/main.rs+1
@@ -112,6 +112,7 @@ fn main() {      kicad_platform::native().init_process();     kicad_platform::native().etiquette_start();+    verbs_libraries::apply_background_guard();     // The white taskbar icon (kicad_taskbar_repair): KiCad's own AUMID onto its standalone     // shortcuts, once per boot, off the request path. Idempotent and never fatal.     std::thread::spawn(|| {
rust/crates/kicad-bridge/src/verbs_libraries.rs+17−2
@@ -62,7 +62,7 @@ pub static VERBS: &[Verb] = &[         mechanism: Mechanism::File, risk: "config", timeout_sec: 10,         input: "{\"overlayBadges\"?: bool, \"activityIndicator\"?: \"progress|flash|both|none\", \"restoreDefaults\"?: bool}",         example: "kicad_set_settings {\"overlayBadges\": false}",-        hint: "kicad_set_settings {\"overlayBadges\": false}. foregroundToastMinutes (default 10) is how often a foreground the calling AI asked for may announce itself with a toast, which ab mirrors to the user's other boxes; 0 turns the toast off, the 3 s on-screen caption on the driven box stays.",+        hint: "kicad_set_settings {\"overlayBadges\": false}. backgroundGuard (default true) is the A/B switch for sending a KiCad window the bridge is opening behind the user window: false means the bridge never pushes or moves any KiCad window. foregroundToastMinutes (default 10) is how often a foreground the calling AI asked for may announce itself with a toast, which ab mirrors to the user's other boxes; 0 turns the toast off, the 3 s on-screen caption on the driven box stays.",         related: &["kicad_get_settings"],         pitfalls: &["live re-badging of open KiCad windows arrives with the window verbs (phase 3); the setting persists now"],     },@@ -93,13 +93,28 @@ pub fn dispatch(state: &mut State, command: &str, args: &Value) -> Option<Value>         "kicad_list_footprints" => list_footprints(state, args),         "kicad_adom_library_status" => adom_library_status(state),         "kicad_get_settings" => get_settings(),-        "kicad_set_settings" => settings::set_settings(args),+        "kicad_set_settings" => {+            let out = settings::set_settings(args);+            apply_background_guard();+            out+        }         "kicad_list_design_rules" => design_rules::list_design_rules(arg_str(args, "fab")),         "kicad_set_design_rules" => set_design_rules(state, args),         _ => return None,     }) } +/// Push the `backgroundGuard` setting into the platform layer. Called at boot and after every+/// settings write, so the dashboard switch takes effect at once with no restart.+pub fn apply_background_guard() {+    let on = settings::get_settings().get("backgroundGuard").and_then(Value::as_bool).unwrap_or(true);+    kicad_platform::native().etiquette_set_enabled(on);+    // activityIndicator: "flash" and "both" keep Windows' orange attention flash, "progress" and+    // "none" cancel it on the windows the bridge owns.+    let mode = settings::get_settings().get("activityIndicator").and_then(Value::as_str).unwrap_or("progress").to_string();+    kicad_platform::native().etiquette_set_flash_suppressed(!matches!(mode.as_str(), "flash" | "both"));+}+ /// The library context for the KiCad this bridge drives: version, install root, /// config and user dirs from the platform, Configure Paths overrides loaded. fn lib_ctx(info: &KicadInfo) -> LibCtx {