Closed general

TODO: keep debugging the background guard (backgroundGuard) before turning it back on by default

John Lauer · ·closed by Colby Knox
roadmap

Decision (John, 2026-09-21): "the default in your latest release should be to have the guard be off. i think you just are too aggressive with it and kicad acts weird when you have it on, so make a todo where we continue to debug it in coming weeks and then maybe we turn it on by default."

From 1.0.50 backgroundGuard defaults to off: the bridge moves no KiCad window at all, and KiCad comes to the front the way it does on its own. Anyone can still turn it on (dashboard: Keep KiCad in the background, or kicad_set_settings {"backgroundGuard": true}); the bridge's focus log records what the guard WOULD have done either way (guard OFF: would have pushed this window), so the two modes can be compared without switching.

This issue is the work before it may be on by default again. Related: #112 (every new KiCad window grabs the foreground for a moment), #113 (taskbar badge, done).

What we learned on 2026-09-21 (AdomLapper, John clicking during live runs)

  • Explorer crashed twice (Taskbar.View.dll, 0xc0000005) when the guard forced "the user's previous window" to the front and that window was the taskbar John had just clicked. Fixed in 1.0.40 (never a shell window) and 1.0.48 (the per-verb check asks instead of forcing).
  • John's own clicks were yanked back. The old rule guessed "was that the user?" from a 120 ms mouse poll and a timing window. 1.0.41 replaced it: only a window the bridge is opening RIGHT NOW may be pushed; every existing KiCad window is the user's. Still wrong in one case: a window the user clicks during the few seconds it is being created.
  • A window opening under the cursor was taken for a click (1.0.46 fix): recent input now only counts with the cursor on the taskbar or Start.
  • Two mechanisms, one switch. The per-verb focus check after every window verb ignored the switch until 1.0.48, so the first "guard off" A/B run was not off.
  • Refused pushes. A window busy loading refuses the push; 1.0.38 retried and hammered Explorer (reverted in 1.0.39). A retry that touches only the KiCad window is still open.
  • KiCad's own setup wizard popped up on every editor start (fixed in 1.0.47), which made the guard look worse than it was.

Before on-by-default again

  1. A full verb battery with the guard ON and the user actively clicking the KiCad taskbar buttons and Alt-Tabbing: zero yanks of a window the user raised, zero Explorer crashes (check Windows' Application log for Explorer.EXE faults).
  2. The same run with a fullscreen video playing: count the moments KiCad covers it (#112).
  3. A preventive guard instead of push-after-the-fact (#112 options), so the window never reaches the front in the first place.
  4. John's A/B verdict on his own machine.

1 Reply

Colby Knox ·

kicad-lane: closing this into #112, which is the same problem. #112 has today's measurement and why it is parked.

The background guard is still off by default (since 1.0.50), and nobody has asked for it back. Any work to turn it on again belongs with #112's design notes (never restore a shell window, let a taskbar click win even when it lands mid-verb, retry pushes on the KiCad window only).

Colby Knox closed this ·

Log in to reply.