#48598: fix: allow disabling all NSMenuItems
Description of Change
Reworks menu item validation to manual management and not the confusing combination of automatic and manual management that's been in use up to now. As it stood, menu items with default system-defined selectors didn't call validateUserInterfaceItem as this class was not where those were defined.
This was previously tried in #46307, but with the missing understanding that disabling autoenablesItems meant validateUserInterfaceItem would no longer be called under any circumstances, and this we need to now shift this logic to menuWillShow and call it ourselves.
Confirmed not to regress #46501, #46593, or #46485
Checklist
- PR description included and stakeholders cc'd
-
npm testpasses - PR release notes describe the change in a way relevant to app developers, and are capitalized, punctuated, and past tense.
Release Notes
Notes: Fixed an issue that menu items on macOS could not be disabled under all circumstances.
Backports
Semver Impact
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