Skip to content

fix(overview): give a launched window the keyboard - #151

Merged
PapyElGringo merged 2 commits into
mainfrom
fix/overview-ephemeral-window-focus
Oct 15, 2026
Merged

PapyElGringo merged 2 commits into
mainfrom
fix/overview-ephemeral-window-focus

Conversation

@PapyElGringo

@PapyElGringo PapyElGringo commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Launching an application from the overview left the search pane holding the Flutter focus, so the overview's ActivateIntent kept intercepting Enter: pressing it to validate something in the focused ephemeral window launched another instance instead of reaching the client. Typing worked only because plain letters have no handler and were forwarded to the client.

A displayed ephemeral window now owns the keyboard, and every way of getting to it hands it back:

  • launching an application hands focus to the surface as soon as it is mapped (SurfaceFocus);
  • while the surface is still pending, the launch placeholder holds the keyboard, so Enter during the wait cannot relaunch either;
  • clicking the window (or placeholder) requests the window's focus node — the compositor already activates the client on pointer down, this keeps the Flutter focus in step;
  • selecting the window's panel tab requests the same node, which also covers the re-click where selectContent changes nothing and no widget remounts.

SurfaceFocus already shadows activation, dismissal and traversal keys (Enter, Space, Escape, Tab, directions) with an action that does not consume them, so those keys now fall through to the focused client exactly as the navigation spec describes. The Super chords still move the keyboard back to the search pane to keep launching.

Why this shape

  • The surface node is the only node whose SurfaceFocus forwards Enter/Space/arrows to the client, so parking focus anywhere else (the pane itself) would leave those keys consumed by Flutter.
  • Focus is requested explicitly (not autofocus) because the surface node attaches asynchronously, after the client presents.

Testing

test/ephemeral_window_focus_test.dart covers all four paths:

  • the waiting placeholder takes the keyboard over the search pane;

  • the surface node takes it once the window is matched;

  • clicking the window hands it the keyboard;

  • selecting the displayed window's tab hands it the keyboard (verified to fail without the fix).

  • flutter test — 488 passed

  • flutter analyze — 0 errors

  • dart format --set-exit-if-changed — clean

Docs updated: overview.md, navigation.md, ephemeral_window.md.

Veshell release bot added 2 commits October 15, 2026 11:44
Launching an application from the overview left the search pane holding the
Flutter focus, so the overview's `ActivateIntent` kept intercepting `Enter`:
pressing it to validate something in the focused ephemeral window launched
another instance instead of reaching the client. Typing worked only because
plain letters have no handler and are forwarded.

Hand the keyboard to the window when it is displayed: to its `SurfaceFocus`
node once the native surface is matched, and to the launch placeholder before
that. The surface shadows activation, dismissal and traversal keys with a
non-consuming action, so `Enter`/`Space`/`Escape`/`Tab`/directions fall
through to the client as intended.
The keyboard hand-off only ran when the window widget (re)mounted, so a
pointer click or re-selecting the already-displayed window's tab left the
keyboard where it was — usually the search pane, whose `ActivateIntent` then
launched another instance.

- Clicking the window (or its launch placeholder) requests the window focus
  node; the compositor already activates the client on pointer down, this
  keeps the Flutter focus in step.
- Selecting a window's panel tab requests the same node, covering the re-click
  where `selectContent` changes nothing and nothing remounts.
@PapyElGringo
PapyElGringo merged commit 51016e9 into main Oct 15, 2026
2 checks passed
@PapyElGringo
PapyElGringo deleted the fix/overview-ephemeral-window-focus branch October 15, 2026 10:30
@PapyElGringo PapyElGringo mentioned this pull request Oct 16, 2026
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