Skip to content

Linux: a KiCad pane off the page takes no input or focus (the focus proxy only where its frame is on screen; no presses off page) - #1556

Merged
i2cjak merged 4 commits into
mainfrom
fix/pane-press-off-page
Nov 21, 2026
Merged

i2cjak merged 4 commits into
mainfrom
fix/pane-press-off-page

Conversation

@i2cjak

@i2cjak i2cjak commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Closes the Linux regression found by the Browser-tab row of #1505: with a KiCad pane in the window (but not on screen), a click into a Browser page gave the page no keys. Per the KiCad lead: a pane that is off the page must not take input or focus.

1. The focus proxy applies only while a KiCad pane's frame is on screen in that window (viewers/native_child.rs, Linux).

  • The rule: with another viewer on show (the Browser, Files, the board viewer), the pane's frame is unmapped. Nothing of KiCad is under the pointer, and the descendant rule can't deliver a key to it, so the redirect stays off and the focus stays where GPUI and the Browser put it, as before Linux: keys typed over the embedded KiCad pane stay Backplane's (a focus proxy GPUI reads) #1505.
  • What went wrong without it: the Browser's own click hand-back (CefPage::render → want_yank → give_keyboard(false) → focus_host(top), traced) put the focus on the top-level, and the redirect then moved it to the proxy.
  • PaneScreens: top-level → the children on screen in it. It's keyed per child, so the Browser lane can register a shown page too, and it's unit-tested.
  • What the pane reports: each tick it reports (top-level, container) as on screen when in_page and its last placement showed a frame. It takes the entry back when either changes, and when it's dropped.
  • What follows from it: home_of, pump()'s FocusIn redirect, note_pane_keys' transition and re-check, and the proxy's first move all apply only where a pane is on screen. Coming on screen with the focus on the top-level itself (and Backplane holding the keys) moves it to the proxy again.

2. No press handling while the pane is not in the page (viewers/kicad_pane.rs). The hidden pane handled presses by its frame's old rectangle, where the Browser page now is, and on release handed the keyboard to the hidden KiCad frame (traced).

3. The Browser e2e (test/kicad_embed/embed_pointer_keys_browser_e2e.sh):

  • the page is JSON-quoted in the client's script (it never ran before);
  • B3 reads the page's own log;
  • the focus through the page click is traced.

Measured (desktop Xvfb + i3, a cef client from this branch):

  • Browser with a KiCad pane in the window and the Browser on show: B3 passes, the click giving the page its keys; before this change, 3/3 failed. The focus timeline shows Chromium keeping it.
  • B2 and B4 (keys typed with the pointer resting over the page, no click) still go to the page, with or without a pane. That's the Browser's own exposure, as before Linux: keys typed over the embedded KiCad pane stay Backplane's (a focus proxy GPUI reads) #1505; lane t1795239779-667 (fix/browser-keys-proxy) extends the proxy to it.
  • embed_pointer_keys_e2e.sh: case b 13/13 and case a 13/13, the race 20/20 in both.
  • Client cargo test: 917 passed. windows-check gpui is clean.

Split view (a KiCad pane and the Browser both on screen in one window): the pane's frame is on screen, so the redirect is on. A click into the Browser page is then yanked by the Browser's own code and moved to the proxy, as on main today. That case is the Browser lane's: its fix (the person's click from XI2 raw presses, the page registered in PaneScreens) must cover it.

🤖 Generated with Claude Code

@i2cjak
i2cjak force-pushed the fix/pane-press-off-page branch from fcdf30c to 38d2888 Compare November 21, 2026 05:55
@i2cjak i2cjak changed the title kicad pane: no press handling while the pane is not in the page (a click in the Browser tab went to the hidden editor) Linux: a KiCad pane off the page takes no input or focus (the focus proxy only where its frame is on screen; no presses off page) Nov 21, 2026
i2cjak pushed a commit that referenced this pull request Nov 21, 2026
…e map; the key taken back in detach(); the came move counted against the redirect cap; pane-side tests (#1556 review 2, 3, 4)

The tick reported the frame on screen up to 40 ms after it was mapped: a key typed in between, the pointer resting where the pane
appeared, went to KiCad. A pane whose container another takes over (take_kept) could remove that pane's entry from its own late tick
or Drop: detach() now takes its key back and forgets it. pane_shows and screen_rekey are pure and tested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@i2cjak
i2cjak force-pushed the fix/pane-press-off-page branch from 38d2888 to 43cb72e Compare November 21, 2026 06:12
i2cjak pushed a commit that referenced this pull request Nov 21, 2026
…before the old container goes (the old window no longer redirects with no frame in it until the next tick); pane_shows and screen_rekey moved above mac_shown's doc comment; note_pane_on_screen's doc names every caller

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
i2cjak pushed a commit that referenced this pull request Nov 21, 2026
…e map; the key taken back in detach(); the came move counted against the redirect cap; pane-side tests (#1556 review 2, 3, 4)

The tick reported the frame on screen up to 40 ms after it was mapped: a key typed in between, the pointer resting where the pane
appeared, went to KiCad. A pane whose container another takes over (take_kept) could remove that pane's entry from its own late tick
or Drop: detach() now takes its key back and forgets it. pane_shows and screen_rekey are pure and tested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@i2cjak
i2cjak force-pushed the fix/pane-press-off-page branch from 5c3d9a4 to 6b66f90 Compare November 21, 2026 06:18
i2cjak pushed a commit that referenced this pull request Nov 21, 2026
…before the old container goes (the old window no longer redirects with no frame in it until the next tick); pane_shows and screen_rekey moved above mac_shown's doc comment; note_pane_on_screen's doc names every caller

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
i2cjak pushed a commit that referenced this pull request Nov 21, 2026
…e map; the key taken back in detach(); the came move counted against the redirect cap; pane-side tests (#1556 review 2, 3, 4)

The tick reported the frame on screen up to 40 ms after it was mapped: a key typed in between, the pointer resting where the pane
appeared, went to KiCad. A pane whose container another takes over (take_kept) could remove that pane's entry from its own late tick
or Drop: detach() now takes its key back and forgets it. pane_shows and screen_rekey are pure and tested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@i2cjak
i2cjak force-pushed the fix/pane-press-off-page branch from 6b66f90 to 37a17a3 Compare November 21, 2026 06:28
i2cjak pushed a commit that referenced this pull request Nov 21, 2026
…before the old container goes (the old window no longer redirects with no frame in it until the next tick); pane_shows and screen_rekey moved above mac_shown's doc comment; note_pane_on_screen's doc names every caller

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
i2cjak and others added 4 commits November 21, 2026 02:02
…her viewer on show)

The hidden pane's frame rectangle is where that viewer's page now is: a click in the Browser tab's page was taken for a press in the
editor, and its release handed the keyboard to the hidden KiCad frame (kicad_focus at the release, traced), taking it from the page the
person clicked. in_page (false when the thread's viewer holds no editor) gates it; the press state is cleared while out of the page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… is on screen (per top-level, per child); the Browser e2e's page JSON-quoted, its B3 reading the page's own log

With another viewer on show (the Browser tab) a pane's frame is unmapped: nothing of KiCad is under the pointer, so the redirect stays
off and the focus is where GPUI and the Browser put it, as before #1505. The Browser's own click hand-back (its want_yank) put the
focus on the top-level and the redirect then moved it to the proxy: a click into a Browser page with a KiCad pane in the window gave
the page no keys. PaneScreens (top-level -> children on screen) is tested; the pane reports (top-level, container) each tick and takes it
back when either changes or it is dropped; coming on screen moves a focus left on the top-level to the proxy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e map; the key taken back in detach(); the came move counted against the redirect cap; pane-side tests (#1556 review 2, 3, 4)

The tick reported the frame on screen up to 40 ms after it was mapped: a key typed in between, the pointer resting where the pane
appeared, went to KiCad. A pane whose container another takes over (take_kept) could remove that pane's entry from its own late tick
or Drop: detach() now takes its key back and forgets it. pane_shows and screen_rekey are pure and tested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…before the old container goes (the old window no longer redirects with no frame in it until the next tick); pane_shows and screen_rekey moved above mac_shown's doc comment; note_pane_on_screen's doc names every caller

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@i2cjak
i2cjak force-pushed the fix/pane-press-off-page branch from 37a17a3 to a379190 Compare November 21, 2026 07:02
@i2cjak
i2cjak merged commit e6e6c10 into main Nov 21, 2026
16 of 19 checks passed
i2cjak pushed a commit that referenced this pull request Nov 21, 2026
…e map; the key taken back in detach(); the came move counted against the redirect cap; pane-side tests (#1556 review 2, 3, 4)

The tick reported the frame on screen up to 40 ms after it was mapped: a key typed in between, the pointer resting where the pane
appeared, went to KiCad. A pane whose container another takes over (take_kept) could remove that pane's entry from its own late tick
or Drop: detach() now takes its key back and forgets it. pane_shows and screen_rekey are pure and tested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant