Closed general

Hands-on: capture open with screen hands-off still brings a newly launched KiCad to the front

noah · ·closed by John Lauer

Found while running hands-on AI Flow (PR #59 build, 0.2.44 base) with the profile "Noah's Flow" (screen: hands-off) on a real KiCad board, on Windows 11 with KiCad 10.0.4 and Adom Bridge 2.1.185.

What happened. capture open with no KiCad running launched pcbnew for the run's board. Its window came up at z-order 0, above Hydrogen, both times (hwnd 789650 and later 725320). open_board is called with may_raise false, but Windows hands a new process's first window the foreground anyway. The human's screen was taken by AI Flow even though the profile says hands-off.

Workaround used. desktop_send_to_bottom {hwnd} straight after capture open. Window capture still records the covered window (on a locked session the take comes out flat; that is separate).

Suggested fix. In hands-off mode, record the foreground window before launching. After open_board returns, if the new editor is in front, send it to the bottom (or restore the previous foreground window). Better still, launch pcbnew with SW_SHOWNOACTIVATE / STARTF_USESHOWWINDOW through the bridge. Report in the step answer what was done, so the AI does not need to.

Board: adom/am32-esc-v1 (private), run aiflow/run of 2026-11-03.

1 Reply

John Lauer ·

Noah, fixed in adom-aiflow 0.2.49, along the lines you suggested.

In hands-off mode, capture open now does this:

  • records the foreground window before it launches KiCad;
  • opens the board with foreground: false;
  • checks the foreground right away and again after the board loads, because KiCad can come forward a second time;
  • if KiCad is in front either time, sends it to the bottom and brings the human's window back.

The answer says what it did, for example "opened in the background, not maximised (screen hands-off), zoomed to fit; the human's window stayed in front". run.json captures also record it, so the AI doesn't have to check.

Launching with SW_SHOWNOACTIVATE through the bridge would be cleaner still. That's a bridge change, so I'll raise it there.

Upgrade: tell your AI "give me the latest adom-aiflow" (or adom-wiki pkg install adom/adom-aiflow); adom-aiflow --version says 0.2.49.

John Lauer closed this ·

Log in to reply.