fix: refresh menu item state on key equivalent dispatch#49875
Merged
Conversation
jkleinsc
approved these changes
Feb 20, 2026
|
Release Notes Persisted
|
This was referenced Feb 20, 2026
Contributor
|
I have automatically backported this PR to "39-x-y", please check out #49888 |
Contributor
|
I have automatically backported this PR to "40-x-y", please check out #49889 |
Contributor
|
I have automatically backported this PR to "41-x-y", please check out #49890 |
kycutler
pushed a commit
to kycutler/electron
that referenced
this pull request
Feb 26, 2026
4 tasks
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.
Description of Change
Closes #49841
Refs #49549
Refs #48598
With
autoenablesItems = NO, macOS doesn't re-validate menu items while the menu is closed. Previously this was worked around by forcingitem.enabled = YESwhen closed|| !isMenuOpen_, which meant shortcuts could fire even for intentionally disabled items.This replaces that workaround with
menuNeedsUpdate:, which AppKit calls both before displaying a menu and during key equivalent matching — even while closed. This ensures item state is always synced from the model before AppKit decides whether to dispatch.Also removes the now-redundant
refreshMenuTree:calls inmenuWillOpen:/menuDidClose:.Checklist
npm testpassesRelease Notes
Notes: Fixed an issue where menu item enabled state wasn't updated during key equivalent dispatch when the menu was closed on macOS.