Skip to content

Preserve and restore focus across window activation cycles#47044

Merged
mikayla-maki merged 1 commit intomainfrom
fix-zoom-focus-restoration
Jan 17, 2026
Merged

Preserve and restore focus across window activation cycles#47044
mikayla-maki merged 1 commit intomainfrom
fix-zoom-focus-restoration

Conversation

@mikayla-maki
Copy link
Copy Markdown
Member

@mikayla-maki mikayla-maki commented Jan 17, 2026

Closes #46953

This turned out to be a pretty deep rabbit hole, ultimately landing in how GPUI didn't restore focus nicely when swapping window activation states.

Release Notes:

  • N/A

When a window deactivates, save the current focus and clear it.
When the window reactivates, restore the saved focus. This keeps
window.focus consistent with focus events (which use empty paths
when inactive) and prevents spurious focus changes on reactivation
that could trigger unintended behavior like dismissing zoomed dock
panels.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jan 17, 2026
@mikayla-maki mikayla-maki marked this pull request as ready for review January 17, 2026 02:48
@mikayla-maki mikayla-maki enabled auto-merge (squash) January 17, 2026 02:48
@mikayla-maki mikayla-maki merged commit 4064af3 into main Jan 17, 2026
27 checks passed
@mikayla-maki mikayla-maki deleted the fix-zoom-focus-restoration branch January 17, 2026 02:57
ConradIrwin added a commit that referenced this pull request Jan 28, 2026
@ConradIrwin ConradIrwin mentioned this pull request Jan 28, 2026
@ConradIrwin
Copy link
Copy Markdown
Member

I'm not sure why yet but this seems to have broken emoji input on macOS with the cmd-control-space picker. 'm reverting in #47835

ConradIrwin added a commit that referenced this pull request Jan 28, 2026
- **Revert "ui: Dismiss context menus when window loses focus
(#46866)"**
- **Revert "Preserve and restore focus across window activation cycles
(#47044)"**

Closes #ISSUE

Release Notes:

- (preview only) Fixed typing emoji using the macOS system palette
(cmd-ctrl-space)
github-actions Bot pushed a commit that referenced this pull request Jan 28, 2026
- **Revert "ui: Dismiss context menus when window loses focus
(#46866)"**
- **Revert "Preserve and restore focus across window activation cycles
(#47044)"**

Closes #ISSUE

Release Notes:

- (preview only) Fixed typing emoji using the macOS system palette
(cmd-ctrl-space)
zed-zippy Bot added a commit that referenced this pull request Jan 28, 2026
Cherry-pick of #47835 to preview

----
- **Revert "ui: Dismiss context menus when window loses focus
(#46866)"**
- **Revert "Preserve and restore focus across window activation cycles
(#47044)"**

Closes #ISSUE

Release Notes:

- (preview only) Fixed typing emoji using the macOS system palette
(cmd-ctrl-space)

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The terminal panel is closed when working in other windows, while zoomed

2 participants