← Commit history

0.9.286: Z-order guard fix: the 0.9.285 guard read AD's window list with the wrong envelope shape and always saw nothing (field test reported 'no window was launched' during a real relaunch). Both the Symbol Editor launch guard and handlers/foreground_guard now read z-order through handlers.kicad_windows, the one parser of AD's desktop_list_windows.

John Lauer ·b02f0f65dd ·1mo ago ·parent 0765c36
3 files changed +9−7
BRIDGE_VERSION+1−1
@@ -1 +1 @@-0.9.285\ No newline at end of file+0.9.286\ No newline at end of file
bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "kicad",   "displayName": "KiCad EDA",-  "version": "0.9.285",+  "version": "0.9.286",   "description": "Reverse bridge for KiCad \u2014 board/schematic introspection, lint via kicad-cli, plugin install, multi-instance probe, in-process DRC.",   "homepage": "https://wiki.adom.inc/adom/adom-bridge",   "author": "Adom Inc.",
handlers/foreground_guard.py+7−5
@@ -58,13 +58,15 @@ GUARD_WINDOW_MS = 200   def _top_window(ab_call) -> int | None:-    """hwnd currently at the top of the z-order, or None if unreadable."""+    """hwnd currently at the top of the z-order, or None if unreadable.+    Goes through handlers.kicad_windows, which knows AD's response envelope+    (output -> data -> windows); reading res["windows"] directly sees nothing."""     try:-        res = ab_call("desktop_list_windows", {})-        wins = (res or {}).get("windows") or []-        if not wins:+        from handlers import kicad_windows+        rows = [r for r in (kicad_windows.find(all_windows=True, fresh=True) or []) if r.get("z") is not None]+        if not rows:             return None-        return sorted(wins, key=lambda w: w.get("z", 10**9))[0].get("hwnd")+        return sorted(rows, key=lambda r: r.get("z"))[0].get("hwnd")     except Exception:  # pylint: disable=broad-except         return None