-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
ui: Dismiss context menus when window loses focus #46866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
danilo-leal
merged 2 commits into
zed-industries:main
from
notnotjake:proposed/context-menu-dismiss-on-blur
Jan 15, 2026
Merged
ui: Dismiss context menus when window loses focus #46866
danilo-leal
merged 2 commits into
zed-industries:main
from
notnotjake:proposed/context-menu-dismiss-on-blur
Jan 15, 2026
Conversation
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
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.
danilo-leal
approved these changes
Jan 15, 2026
Member
danilo-leal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
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>
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: