Skip to content

fix: call activate_application for already-frontmost apps to fix keyboard focus#155

Merged
typester merged 1 commit intomainfrom
fix/focus-issue
Feb 24, 2026
Merged

fix: call activate_application for already-frontmost apps to fix keyboard focus#155
typester merged 1 commit intomainfrom
fix/focus-issue

Conversation

@typester
Copy link
Owner

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.

…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.
@typester typester merged commit 266d3e8 into main Feb 24, 2026
2 checks passed
@typester typester deleted the fix/focus-issue branch February 24, 2026 05:38
@github-actions github-actions bot mentioned this pull request Feb 24, 2026
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>
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