← Commit history

Wishlist: measured focus behaviour and two clips

John Lauer ·6b40a06b3d ·2d ago ·parent 0d703a4
3 files changed +34−27
docs/kicad-wishlist.md+34−27
@@ -20,97 +20,104 @@ Severity: **real input** (the foreground and the user's mouse are taken), **KiCa - **Workaround:** Fire the host frame's menu item, then UI Automation on the launcher. When neither works, the last resort is a real click on the launcher button, which needs the foreground. - **Ask:** A command line argument and an IPC call that open the Symbol or Footprint Editor at a given library item. -### 3. Every new window activates itself (KiCad takes the foreground)-- **Want:** Open a board, a schematic, an editor or the 3D viewer without disturbing what the user is doing.-- **KiCad today:** Starting `pcbnew.exe` / `eeschema.exe` with `SW_SHOWNOACTIVATE` is ignored. The frame comes to the front when its document finishes loading, and again when a second frame of the same process opens.-- **Workaround:** Watch for the activation and push the window back afterwards. The user still sees it flash forward, keyboard focus moves into KiCad for a moment, and a fullscreen video in front is interrupted. In one full test run we counted about 40 of these grabs.-- **Ask:** A way to start KiCad and open documents without activating (a command line flag, an environment variable, or an IPC open-document call that never raises).--### 4. Progress dialogs are top-level and steal focus (KiCad takes the foreground)-- **Want:** Load a board or a library, or refill zones, in the background.-- **KiCad today:** `Load PCB`, `Load Schematic`, `Loading Symbol Libraries` and `Fill All Zones` are separate top-level windows that activate.-- **Workaround:** Same after-the-fact push as above, once per dialog.-- **Ask:** Progress reported through the API (or at least non-activating progress windows), and an IPC event when a load or a fill completes.--### 5. Startup dialogs that block automation (KiCad takes the foreground)+### 3. Opening the Symbol Editor or Footprint Editor takes the user's focus (KiCad takes the foreground)+- **Want:** Open an editor without disturbing what the user is doing.+- **KiCad today:** Measured on KiCad 10.0.5 with the user's Notepad focused and maximized, our own push-back switched off, and the foreground sampled every 20 ms:++  | Action | What the user gets |+  | --- | --- |+  | Open a board (a new `pcbnew.exe`) | Nothing. The PCB Editor opens behind the user's window. |+  | Open the 3D Viewer (menu command in the PCB Editor) | Nothing. It opens behind. |+  | Open the Symbol Editor at `Device:R` | *Loading Symbol Libraries*, then the Symbol Editor, come to the front over the user's window and take keyboard focus. |+  | Open the Footprint Editor | The user's window stays on screen, but keyboard focus moves to an invisible KiCad window. The user's typing goes nowhere until they click back. |++  So KiCad can open frames quietly; these two editors are the ones that do not.++  Videos (14 s each, recorded on that machine):+  - [The Symbol Editor jumps in front of the user's Notepad](videos/kicad-symbol-editor-takes-focus.mp4)+  - [A board opens behind the user, which is what we would like everywhere](videos/kicad-board-opens-behind.mp4)+- **Workaround:** Push the window back after it activates. The user still sees it jump forward and loses keyboard focus for a moment.+- **Ask:** Open the Symbol and Footprint Editors (and their progress dialogs) without activating, the way a board opens today, or a flag or IPC option that guarantees no activation.++### 4. Startup dialogs that block automation (KiCad takes the foreground) - **Want:** Start an editor on a fresh or headless machine and get straight to work. - **KiCad today:** KiCad 10's *Welcome to KiCad* setup wizard appears in every editor start until `kicad.json` has `system.first_run_shown: true`, and cancelling it does not set that flag. On a machine without a usable GPU, *Could not use OpenGL, falling back to software rendering* appears at every start. - **Workaround:** Find each dialog and press its button (`BM_CLICK`), or edit `kicad.json` before launch while no KiCad is running. - **Ask:** Cancelling the wizard should count as answered, and a documented headless or automation flag that suppresses first-run and informational dialogs. -### 6. Save, lock and recovery prompts block closing (KiCad takes the foreground)+### 5. Save, lock and recovery prompts block closing (KiCad takes the foreground) - **Want:** Close an editor the automation opened, or reopen a file. - **KiCad today:** *Save changes?*, file-locked and auto-save-recovery prompts are modal and are the only way to answer. - **Workaround:** `WM_CLOSE`, then find the modal dialog and press a button. A force kill loses unsaved work and leaves stale `.lck` files behind. - **Ask:** An IPC call to close a document or frame with an explicit choice (save, discard, cancel), and to report which documents have unsaved changes. -### 7. Opening the Symbol or Footprint Editor at one part (UI automation)+### 6. Opening the Symbol or Footprint Editor at one part (UI automation) - **Want:** Show `Device:R` in the Symbol Editor. - **KiCad today:** No way to pass a library item to a running editor. - **Workaround:** Type the name into the library tree's search box with UI Automation (or `WM_SETTEXT`), post `VK_DOWN` and `VK_RETURN`, then poll the window title until it shows the part. If the tree pane is hidden, toggle it from the View menu first. On a slow machine the editor does not answer while it loads its libraries, and the attempt fails. - **Ask:** An IPC call to load a given `Library:Item` into the Symbol or Footprint Editor. -### 8. Driving the 3D viewer (UI automation)+### 7. Driving the 3D viewer (UI automation) - **Want:** Rotate, zoom, pan, and frame one part (for example a connector) for a screenshot. - **KiCad today:** No 3D viewer API at all. - **Workaround:** Read the viewer's menu bar and post `WM_COMMAND` with the discovered ids (they differ between versions): Zoom, Rotate, Move Board, view presets. There is no way to set a camera pose or frame a reference designator. - **Ask:** A 3D viewer API: set and read the camera, frame an item or a bounding box, and render a view to an image off-screen. -### 9. Any menu command (UI automation)+### 8. Any menu command (UI automation) - **Want:** Zoom to Selection, View > Refresh, open the Plugin and Content Manager, and similar. - **KiCad today:** These exist as actions but are not reachable through IPC. - **Workaround:** Enumerate the native menu with `GetMenu`, match the label (labels vary by version and language), post `WM_COMMAND` to the right frame. - **Ask:** Run any action by name through IPC (the same ask as the first entry). -### 10. Libraries added while KiCad runs (UI automation)+### 9. Libraries added while KiCad runs (UI automation) - **Want:** Install a library, then open one of its parts. - **KiCad today:** A running KiCad never re-reads `sym-lib-table` or `fp-lib-table`. The only refresh is the user pressing OK in Manage Libraries, or a restart. - **Workaround:** Fire the library tree's refresh through the menu, or close and restart KiCad, which loses the user's window state unless it is saved and restored by hand. - **Ask:** An IPC call to reload the library tables (and the library tree) in a running KiCad. -### 11. Plugin and Content Manager (UI automation)+### 10. Plugin and Content Manager (UI automation) - **Want:** Add a repository and install or update a package. - **KiCad today:** No CLI and no API. Repositories are read from `kicad.json` only at start. - **Workaround:** Write `pcm.repositories` into `kicad.json`, extract packages into the third-party folder and edit `installed_packages.json` by hand, then ask the user to restart. The PCM dialog itself can only be opened through the menu. - **Ask:** PCM commands in `kicad-cli` and the IPC API: list, add repository, install, update, remove, with an event when the library tables change. -### 12. Settings that KiCad overwrites on exit (UI automation)+### 11. Settings that KiCad overwrites on exit (UI automation) - **Want:** Turn on the IPC API server, or change 3D viewer model visibility. - **KiCad today:** Only through the preferences dialogs, or by editing the JSON files. - **Workaround:** Edit `kicad_common.json` or `3d_viewer.json` while no KiCad is running, because a running KiCad writes its in-memory settings back on exit. - **Ask:** Read and write settings through the API, applied live. -### 13. Footprint reference and value fields (API gap)+### 12. Footprint reference and value fields (API gap) - **Want:** Move or resize a footprint's reference text. - **KiCad today:** `UpdateItems` on a `PCB_FIELD_T` answers `ISC_INVALID_TYPE` on 10.0.5. - **Workaround:** Close the editor, edit the saved board file, reopen it. - **Ask:** Field updates through `UpdateItems`. -### 14. 3D model binding per footprint (API gap)+### 13. 3D model binding per footprint (API gap) - **Want:** Change a footprint's model path, offset, rotation or scale. - **KiCad today:** The footprint messages do not expose the model list. - **Workaround:** File edits only. - **Ask:** Read and write a footprint's 3D models through the API. -### 15. Zone refill (API gap)+### 14. Zone refill (API gap) - **Want:** Refill specific zones and know when it is done. - **KiCad today:** `RefillZones` with a list of zone ids answers `AS_UNIMPLEMENTED`; an empty list (all zones) works but runs asynchronously with no completion signal. - **Workaround:** Poll the board until its serialized form stops changing. - **Ask:** Refill by id, and a completion event or a revision that changes only when the fill lands. -### 16. DRC on the live board (API gap)+### 15. DRC on the live board (API gap) - **Want:** Check a proposed edit before committing it. - **KiCad today:** No DRC over IPC. - **Workaround:** Serialize the board, run `kicad-cli pcb drc` on a copy. The report stops at about 199 markers per violation type (499 for clearance), so large boards come back incomplete. - **Ask:** DRC through the API on the live board, with complete results. -### 17. One API server for several editors (API gap)+### 16. One API server for several editors (API gap) - **Want:** Work with two boards open at once. - **KiCad today:** One IPC server per machine; with two PCB Editors open, calls reach only one of them. - **Workaround:** Detect the mismatch and refuse, or close the other editor. - **Ask:** Address a specific document or frame in every IPC call. -### 18. Schematics (API gap)+### 17. Schematics (API gap) - **Want:** Edit a schematic live. - **KiCad today:** The IPC API covers the board editor; the schematic editor has none. - **Workaround:** Edit the `.kicad_sch` file, run ERC with `kicad-cli`, and reload.@@ -125,7 +132,7 @@ Recording KiCad in the background mostly works today. Windows Graphics Capture r So the problem is less about capture than about KiCad taking the foreground and needing real input. The first three asks below would let an automated KiCad session run, and be recorded, without the user ever seeing it.  ### The short version-1. Start KiCad and open documents without activating any window, and make progress dialogs non-activating.+1. Open the Symbol and Footprint Editors (and their progress dialogs) without activating, as boards already do. 2. Run any action by name through the IPC API, aimed at a specific frame. 3. A 3D viewer API: camera pose, frame an item, render off-screen. 4. Open the Symbol or Footprint Editor at a Library:Item from the command line and the API.
docs/videos/kicad-board-opens-behind.mp4added
⋯ 1 unchanged line ⋯
docs/videos/kicad-symbol-editor-takes-focus.mp4added
⋯ 1 unchanged line ⋯