codebytere

#48598: fix: allow disabling all NSMenuItems

Merged
Created: Oct 20, 2025, 3:53:15 AM
Merged: Oct 28, 2025, 10:20:55 AM
5 comments
Target: main

Description of Change

Closes #46505
Closes #43130

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

Release Notes

Notes: Fixed an issue that menu items on macOS could not be disabled under all circumstances.

Backports

37-x-y
In-flight
PR Number
#48712
Waiting to be merged
38-x-y
In-flight
PR Number
#48710
Waiting to be merged
39-x-y
Merged
PR Number
#48711
Merged At
Oct 28, 2025, 1:20:17 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