← Commit history

rust: post_verb no longer clobbers kicad_state.focusEvents

John Lauer ·42ebfa6382 ·27d ago ·parent fdc17f1
1 file changed +5−1
rust/crates/kicad-bridge/src/verbs_windows.rs+5−1
@@ -364,7 +364,11 @@ pub(crate) fn post_verb(state: &mut State, command: &str, args: &Value, out: &mu             events.push(ev);         }     }-    out["focusEvents"] = json!(events);+    // kicad_state already carries the loop's ring buffer; never clobber it with the+    // per-verb list (which is empty while the loop runs).+    if out.get("focusEvents").map(|v| v.as_array().map(|a| a.is_empty()).unwrap_or(true)).unwrap_or(true) {+        out["focusEvents"] = json!(events);+    }     if spawns {         out["_userFocusRestored"] = json!(false);     }