ui: Dismiss context menus when window loses focus#46866
Merged
danilo-leal merged 2 commits intozed-industries:mainfrom Jan 15, 2026
Merged
ui: Dismiss context menus when window loses focus#46866danilo-leal merged 2 commits intozed-industries:mainfrom
danilo-leal merged 2 commits intozed-industries:mainfrom
Conversation
Context menus now close when the window becomes inactive (e.g., clicking to another window or app). Previously, menus would remain visible until the window regained focus. Uses `observe_window_activation` to detect when the window becomes inactive and calls `cancel` to dismiss the menu.
ConradIrwin
added a commit
that referenced
this pull request
Jan 28, 2026
This reverts commit d139c5e.
Merged
Member
|
I'm not sure why yet, but this seems to have caused two problems: the terminal lost focus when window switching, and the macOS emoji picker stopped working. I'm reverting in #47835 |
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>
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.
Context menus close when the window becomes inactive (e.g., clicking to another window or app). Previously, menus would remain visible until the window regained focus.
This aligns Zed's context menu behavior with native macOS apps, where NSMenu automatically dismisses when the window loses focus. Users expect menus to close when switching windows or apps.
Uses
observe_window_activationto detect when the window becomes inactive and callscancelto dismiss the menu.Release Notes: