Skip to content

fix: allow disabling all NSMenuItems#48598

Merged
jkleinsc merged 1 commit intomainfrom
fix-enabled
Oct 28, 2025
Merged

fix: allow disabling all NSMenuItems#48598
jkleinsc merged 1 commit intomainfrom
fix-enabled

Conversation

@codebytere
Copy link
Copy Markdown
Member

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.

@codebytere codebytere added the semver/patch backwards-compatible bug fixes label Oct 20, 2025
@electron-cation electron-cation bot added new-pr 🌱 PR opened recently and removed new-pr 🌱 PR opened recently labels Oct 20, 2025
@nikwen
Copy link
Copy Markdown
Member

nikwen commented Oct 23, 2025

Confirmed not to regress #46501, #46593, or #46485

Thanks for confirming that it doesn't regress those bugs!

@jkleinsc jkleinsc added target/37-x-y PR should also be added to the "37-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch. target/39-x-y PR should also be added to the "39-x-y" branch. labels Oct 28, 2025
@jkleinsc jkleinsc merged commit 0cb4fdd into main Oct 28, 2025
158 of 160 checks passed
@release-clerk
Copy link
Copy Markdown

release-clerk bot commented Oct 28, 2025

Release Notes Persisted

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

@trop
Copy link
Copy Markdown
Contributor

trop bot commented Oct 28, 2025

I have automatically backported this PR to "38-x-y", please check out #48710

@trop trop bot added in-flight/38-x-y and removed target/38-x-y PR should also be added to the "38-x-y" branch. labels Oct 28, 2025
@trop
Copy link
Copy Markdown
Contributor

trop bot commented Oct 28, 2025

I have automatically backported this PR to "39-x-y", please check out #48711

@trop
Copy link
Copy Markdown
Contributor

trop bot commented Oct 28, 2025

I have automatically backported this PR to "37-x-y", please check out #48712

@trop trop bot added in-flight/39-x-y in-flight/37-x-y and removed target/39-x-y PR should also be added to the "39-x-y" branch. target/37-x-y PR should also be added to the "37-x-y" branch. in-flight/39-x-y labels Oct 28, 2025
trop bot added a commit that referenced this pull request Nov 6, 2025
This reverts commit 0cb4fdd.

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
VerteDinde added a commit that referenced this pull request Nov 6, 2025
Revert "fix: allow disabling all `NSMenuItems` (#48598)"

This reverts commit 0cb4fdd.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
VerteDinde added a commit that referenced this pull request Nov 6, 2025
Revert "fix: allow disabling all `NSMenuItems` (#48598)"

This reverts commit 0cb4fdd.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
trop bot added a commit that referenced this pull request Nov 6, 2025
This reverts commit 0cb4fdd.

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
VerteDinde added a commit that referenced this pull request Nov 6, 2025
Revert "fix: allow disabling all `NSMenuItems` (#48598)"

This reverts commit 0cb4fdd.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
VerteDinde pushed a commit that referenced this pull request Nov 7, 2025
* fix: allow disabling all `NSMenuItems` (#48598)

fix: allow disabling all NSMenuItems

* fix: add guard for type

---------

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
trop bot added a commit that referenced this pull request Nov 7, 2025
fix: allow disabling all NSMenuItems

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
trop bot added a commit that referenced this pull request Nov 7, 2025
fix: allow disabling all NSMenuItems

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
trop bot added a commit that referenced this pull request Nov 7, 2025
fix: allow disabling all NSMenuItems

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
VerteDinde added a commit that referenced this pull request Nov 7, 2025
Revert "fix: allow disabling all `NSMenuItems` (#48598)"

This reverts commit 0cb4fdd.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
codebytere added a commit that referenced this pull request Nov 7, 2025
* fix: allow disabling all `NSMenuItems` (#48598)

fix: allow disabling all NSMenuItems

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* fix: add guard for type

Co-authored-by: George Xu <george.xu@slack-corp.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: George Xu <george.xu@slack-corp.com>
codebytere added a commit that referenced this pull request Nov 7, 2025
* fix: allow disabling all `NSMenuItems` (#48598)

fix: allow disabling all NSMenuItems

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* fix: add guard for type

Co-authored-by: George Xu <george.xu@slack-corp.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: George Xu <george.xu@slack-corp.com>
codebytere added a commit that referenced this pull request Nov 7, 2025
* fix: allow disabling all `NSMenuItems` (#48598)

fix: allow disabling all NSMenuItems

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* fix: add guard for type

Co-authored-by: George Xu <george.xu@slack-corp.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: George Xu <george.xu@slack-corp.com>
jkleinsc pushed a commit that referenced this pull request Nov 13, 2025
* fix: allow disabling all `NSMenuItems` (#48598)

fix: allow disabling all NSMenuItems

* fix: add guard for type

---------

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
(cherry picked from commit 38be633)
jkleinsc pushed a commit that referenced this pull request Nov 14, 2025
* fix: add guard for type

Co-authored-by: George Xu <george.xu@slack-corp.com>

* fix(reland): allow disabling all `NSMenuItems` (#48795)

* fix: allow disabling all `NSMenuItems` (#48598)

fix: allow disabling all NSMenuItems

* fix: add guard for type

---------

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
(cherry picked from commit 38be633)

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: George Xu <george.xu@slack-corp.com>
Co-authored-by: George Xu <33054982+georgexu99@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
nilayarya pushed a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
fix: allow disabling all NSMenuItems
nilayarya pushed a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
…#48794)

Revert "fix: allow disabling all `NSMenuItems` (electron#48598)"

This reverts commit 0cb4fdd.
nilayarya pushed a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
* fix: allow disabling all `NSMenuItems` (electron#48598)

fix: allow disabling all NSMenuItems

* fix: add guard for type

---------

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
fix: allow disabling all NSMenuItems
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
…#48794)

Revert "fix: allow disabling all `NSMenuItems` (electron#48598)"

This reverts commit 0cb4fdd.
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
* fix: allow disabling all `NSMenuItems` (electron#48598)

fix: allow disabling all NSMenuItems

* fix: add guard for type

---------

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
fix: allow disabling all NSMenuItems
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
…#48794)

Revert "fix: allow disabling all `NSMenuItems` (electron#48598)"

This reverts commit 0cb4fdd.
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
* fix: allow disabling all `NSMenuItems` (electron#48598)

fix: allow disabling all NSMenuItems

* fix: add guard for type

---------

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/37-x-y PR was merged to the "37-x-y" branch. merged/38-x-y PR was merged to the "38-x-y" branch. merged/39-x-y PR was merged to the "39-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Impossible to disable context menu items with role on macOS [Bug]: Window with minimizable: false still shows activatable "Minimize" menu item

4 participants