codebytere

#49553: fix: macOS menu item accelerators when item disabled

Merged
Created: Jan 28, 2026, 3:19:13 AM
Merged: Jan 30, 2026, 3:07:16 AM
4 comments
Target: main

Description of Change

Closes #49549.
Refs #48598.

Fixes an issue where menu item accelerators stopped working after the item's enabled property was toggled.

To fix this we keep menu items enabled for shortcut purposes when the menu is closed, and only apply the disabled state when the menu is visually open. This mirrors the behavior of validateUserInterfaceItem, which would have handled this automatically in the menu.autoenablesItems = YES; case. When the menu closes, we now call refreshMenuTree to re-enable items for keyboard shortcut handling.

Tested with https://gist.github.com/4cad43fe183393ff57a0b46ac55bfbf3.

Checklist

Release Notes

Notes: Fixed an issue where menu item accelerators stopped working after the item's enabled property was toggled on macOS.

Backports

39-x-y
Merged
PR Number
#49593
Merged At
Jan 30, 2026, 1:52:17 PM
Released In
Not yet
Release Date
Not yet
40-x-y
Merged
PR Number
#49592
Merged At
Jan 30, 2026, 12:18:36 PM
Released In
Not yet
Release Date
Not yet
41-x-y
Merged
PR Number
#49591
Merged At
Jan 30, 2026, 12:16:11 PM
Released In
Not yet
Release Date
Not yet

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron