app
KiCad - the KiCad Bridge
Public Made by Adomby adom
Reference implementation of the KiCad bridge: multi-instance Python server, forward path via kicad-cli, reverse path via in-process plugin. Most complex of the three bundled bridges.
← Commit history
v0.9.103: end-of-verb restore is KiCad-conditional — never re-raise the start-of-verb snapshot over a window the user has since chosen (was yanking John's browser to fg)
5 files changed
+21−11
BRIDGE_VERSION+1−1@@ -1 +1 @@-0.9.102+0.9.103
adom-bridge-kicad-manifest.json+5−5@@ -1,15 +1,15 @@ { "manifest_version": 1, "name": "kicad",- "version": "0.9.102",- "url": "https://wiki.adom.inc/download/adom/kicad-bridge/0.9.102/adom-bridge-kicad-v0.9.102.zip",- "sha256": "6b772fce143ccfa5f180f906cf2df88e80b11c83eeef15c7bde44d8bf4a18441",- "size": 394342,+ "version": "0.9.103",+ "url": "https://wiki.adom.inc/download/adom/kicad-bridge/0.9.103/adom-bridge-kicad-v0.9.103.zip",+ "sha256": "90822ed96ed63ac17a05144838472188f3dd591fa785b8ff520d622892adc7da",+ "size": 395356, "verbPrefixes": [ "kicad_" ], "healthEndpoint": "/status",- "released_at": "2026-08-15T09:58:18Z",+ "released_at": "2026-08-15T10:04:17Z", "hero": "https://wiki.adom.inc/blob/app/kicad-bridge/kicad-hero.png", "languages": [ "Python",
adom-bridge-kicad-v0.9.103.zipadded⋯ 1 unchanged line ⋯
bridge.json+1−1@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "kicad", "displayName": "KiCad EDA",- "version": "0.9.102",+ "version": "0.9.103", "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/win_focus.py+14−4@@ -59,16 +59,26 @@ def _set_foreground_robust(hwnd) -> bool: def restore_foreground(hwnd) -> bool:- """Put the user's window (captured earlier) back in front. No-op if it's gone- or already foreground. This is what makes a KiCad open 'background' from the- user's point of view — their window returns to the top the instant we're done."""+ """Put the user's window (captured earlier) back in front — but ONLY if a+ KiCad window is currently holding the foreground.++ v0.9.103 (John: "do you keep bringing this browser window to the fg? that's+ rude."): the captured hwnd is a SNAPSHOT from verb START. During a long verb+ the user may deliberately switch windows; blindly re-raising the snapshot at+ verb END yanked them out of their new window and back into the old one (his+ browser). Rule — identical to the guardian loop's: if the current foreground+ is any NON-KiCad window, the user is where they chose to be; touch NOTHING.+ Only when KiCad itself holds the foreground do we hand focus back.""" if not IS_WINDOWS or not hwnd: return False try: if not _user32.IsWindow(hwnd) or not _user32.IsWindowVisible(hwnd): return False- if _user32.GetForegroundWindow() == hwnd:+ fg = _user32.GetForegroundWindow()+ if fg == hwnd: return True+ if fg and not is_kicad_window(fg):+ return False # user moved on — never fight their choice return _set_foreground_robust(hwnd) except Exception: return False