Skip to content

feat: add Menu.setHighlightColors() for Windows - #55494

Merged
MarshallOfSound merged 4 commits into
46-x-yfrom
trop/46-x-y-bp-feat-add-menu-sethighlightcolors-for-windows-1793316430571
Oct 30, 2026
Merged

MarshallOfSound merged 4 commits into
46-x-yfrom
trop/46-x-y-bp-feat-add-menu-sethighlightcolors-for-windows-1793316430571

Conversation

@trop

@trop trop Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Backport of #55074

See that PR for details.

Notes: Added Menu.setHighlightColors() to set menu highlight colors on Windows.

trop Bot and others added 4 commits October 29, 2026 23:27
Lets apps set the background and text color of the hovered or
keyboard-focused item in Views menus on Windows. The colors are
skipped in high contrast and forced colors modes.

Closes #54953

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

Co-authored-by: Ashley Hendrata <ashley.m.hendrata@gmail.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

Co-authored-by: Ashley Hendrata <ashley.m.hendrata@gmail.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

Co-authored-by: Ashley Hendrata <ashley.m.hendrata@gmail.com>
Light and dark colors are now set independently, with no fallback
between modes, and validation errors name the mode (for example
'dark.background').

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

Co-authored-by: Ashley Hendrata <ashley.m.hendrata@gmail.com>
@trop trop Bot mentioned this pull request Oct 29, 2026
7 tasks done
@trop trop Bot added 46-x-y backport This is a backport PR backport/requested 🗳 semver/minor backwards-compatible functionality labels Oct 29, 2026

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed this backport and didn't find any bugs. It adds a new public API (Menu.setHighlightColors) to a release branch and hooks into the browser-wide ColorProvider pipeline, so a maintainer should still look at it. I reviewed it from a standalone clone, without the Chromium sources.

What was reviewed:

  • Argument parsing in Menu::SetHighlightColors: a non-object options value, a non-object or null light/dark, and non-string or invalid colors all throw before any state is stored, and null/undefined resets the colors to the defaults.
  • AddMenuHighlightColorMixer skips high-contrast and forced-colors keys and picks the light or dark colors from key.color_mode. It is only registered on Windows, after AddChromeColorMixers. The binding stays reachable on macOS and Linux, where it does nothing, which matches the docs.
  • The new files are listed in filenames.gni. The docs have an API history block, and the vitest specs use expect matchers.
Extended reasoning...

The change adds a static Menu binding, a new shell/browser/ui/menu_highlight_colors.{h,cc} pair holding process-global colors, a Windows-only ColorProvider initializer in electron_browser_main_parts.cc, docs and specs. It touches no IPC, renderer-reachable, permission or other security-sensitive surface; the input is main-process JS only. I couldn't find a defect in the diff. I deferred because this is a new public feature going to a release branch, which usually needs maintainer sign-off. Also, from this checkout I can't check how ResetColorProviderCache and the mixer ordering behave upstream, or confirm that they actually affect the Views menu colors.

@MarshallOfSound
MarshallOfSound merged commit 3853a53 into 46-x-y Oct 30, 2026
105 checks passed
@MarshallOfSound
MarshallOfSound deleted the trop/46-x-y-bp-feat-add-menu-sethighlightcolors-for-windows-1793316430571 branch October 30, 2026 06:27
@release-clerk

release-clerk Bot commented Oct 30, 2026

Copy link
Copy Markdown

Release Notes Persisted

Added Menu.setHighlightColors() to set menu highlight colors on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

46-x-y backport/approved ✅ backport This is a backport PR semver/minor backwards-compatible functionality

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants