Skip to content

fix(window): the keyboard comes back from another app's panel - #1313

Closed
leookun wants to merge 1 commit into
mainfrom
fix/key-back-after-foreign-panel
Closed

leookun wants to merge 1 commit into
mainfrom
fix/key-back-after-foreign-panel

Conversation

@leookun

@leookun leookun commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

A panel that takes the keyboard without bringing its app in front (the Launchpad's, Spotlight's, Bob's screenshot translation) left BaoCode the active app, traffic lights lit, with no window key once it went: keys typed went nowhere till a click on the window. The event log showed view 0 unfocused with no lifecycle inactive, and a Right Control held for the app, not the system.

  • KeyReturn (macos/Runner/FocusWatch.swift): with the app active and no window key after a BaoWindow resigned it, the other apps' windows over it are looked at every 0.25 s; once one not there as it was last key has shown and then been gone two looks in a row, the window is made key again ([focus] key again after … s). Gives up after 10 minutes.
  • HeldKeys (lib/platform/held_keys.dart): the held modifiers are checked against the system's as a window is key again, not only on a click or on resume.

Tested: flutter test test/platform/held_keys_test.dart, flutter build macos --debug. Not yet tried against the Launchpad → Bob flow by hand.

🤖 Generated with BaoCode

A panel that takes the keyboard without bringing its app in front (the
Launchpad's, Spotlight's, Bob's to translate a screenshot) left BaoCode
the active app, its traffic lights lit, with no window key once it went:
keys typed went nowhere till a click on the window, and the modifier
whose key up went to the panel stayed held for the app.

The window is now made key again once the other app's windows that were
not over it as it was last key are gone, and the held modifiers are
checked against the system's as a window is key again.

Co-Authored-By: BaoCode <noreply@baocode.dev>
@leookun

leookun commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

Closing: the keyboard not coming back after Bob's screenshot translation happens in Chrome too (Window Server windows left after Bob's capture), so it is not BaoCode's to work around.

@leookun leookun closed this Nov 25, 2026
@kun6687
kun6687 deleted the fix/key-back-after-foreign-panel branch November 25, 2026 11:54
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.

2 participants