fix: call activate_application for already-frontmost apps to fix keyboard focus#155
Merged
fix: call activate_application for already-frontmost apps to fix keyboard focus#155
Conversation
…oard focus Some apps (e.g., Firefox) don't change their key window in response to set_main/raise alone when already frontmost. Since AXFrontmost is a no-op in that case, windows on secondary displays fail to get keyboard focus when auto-raised or tag-switched. Now call activate_application even when already frontmost to force macOS to re-evaluate the key window. Cross-display redirect from this activation is handled by FocusIntent suppression. Add refocus_window (set_main + raise only, no activation) for the spurious suppression path, preventing activation → redirect → suppression loops.
Merged
typester
pushed a commit
that referenced
this pull request
Feb 25, 2026
## 🤖 New release * `yashiki-ipc`: 0.11.6 -> 0.12.0 * `yashiki`: 0.11.6 -> 0.12.0 * `yashiki-layout-tatami`: 0.11.6 -> 0.12.0 * `yashiki-layout-byobu`: 0.11.6 -> 0.12.0 <details><summary><i><b>Changelog</b></i></summary><p> ## `yashiki-ipc` <blockquote> ## [0.12.0](yashiki-ipc-v0.11.6...yashiki-ipc-v0.12.0) - 2026-02-25 ### Added - [**breaking**] add keybinding mode system (river-style) ([#157](#157)) </blockquote> ## `yashiki` <blockquote> ## [0.12.0](yashiki-v0.11.6...yashiki-v0.12.0) - 2026-02-25 ### Added - [**breaking**] add keybinding mode system (river-style) ([#157](#157)) - update focused_display via auto-raise when cursor moves to different display ([#156](#156)) ### Fixed - call activate_application for already-frontmost apps to fix keyboard focus ([#155](#155)) </blockquote> ## `yashiki-layout-tatami` <blockquote> ## [0.7.3](yashiki-layout-tatami-v0.7.2...yashiki-layout-tatami-v0.7.3) - 2026-01-20 ### Other - update Cargo.lock dependencies </blockquote> ## `yashiki-layout-byobu` <blockquote> ## [0.7.3](yashiki-layout-byobu-v0.7.2...yashiki-layout-byobu-v0.7.3) - 2026-01-20 ### Other - update Cargo.lock dependencies </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some apps (e.g., Firefox) don't change their key window in response to set_main/raise alone when already frontmost. Since AXFrontmost is a no-op in that case, windows on secondary displays fail to get keyboard focus when auto-raised or tag-switched.
Now call activate_application even when already frontmost to force macOS to re-evaluate the key window. Cross-display redirect from this activation is handled by FocusIntent suppression.
Add refocus_window (set_main + raise only, no activation) for the spurious suppression path, preventing activation → redirect → suppression loops.