Skip to content

fix: report the system accent colour consistently on Windows - #54405

Merged
MarshallOfSound merged 2 commits into
45-x-yfrom
trop/45-x-y-bp-fix-report-the-system-accent-colour-consistently-on-windows-1790354525741
Sep 25, 2026
Merged

MarshallOfSound merged 2 commits into
45-x-yfrom
trop/45-x-y-bp-fix-report-the-system-accent-colour-consistently-on-windows-1790354525741

Conversation

@trop

@trop trop Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Backport of #54353

See that PR for details.

Notes: Fixed accent-color-changed on Windows reporting a colour that differed from systemPreferences.getAccentColor().

trop Bot and others added 2 commits September 25, 2026 16:42
systemPreferences read HKCU\...\DWM\AccentColor directly for
getAccentColor() but emitted 'accent-color-changed' with the DWM
*colorization* colour from WM_DWMCOLORIZATIONCOLORCHANGED, formatted by a
separate lowercase helper, so the event's newColor did not match
getAccentColor() and the change de-duplication never matched on the first
event. NativeWindowViews kept two more registry readers for the same key.

Use ui::AccentColorObserver for all of it: it watches the DWM key, prefers
the UISettings value Windows actually applies, and exposes
ShouldUseAccentColorForWindowFrame(). This removes systemPreferences'
hidden WS_POPUP broadcast window.

Co-authored-by: Sam Attard <[email protected]>
…ations

NativeWindowViews read the observer's cached colour from the
WM_DWMCOLORIZATIONCOLORCHANGED / WM_SETTINGCHANGE handlers, which can run
before the observer's registry watch has refreshed that cache, and nothing
reapplied the colour afterwards. Subscribe to the observer instead and drop
the message handlers. Also emit systemPreferences' accent-color-changed from
a posted task rather than from inside the observer's notification.

Co-authored-by: Sam Attard <[email protected]>
@trop
trop Bot requested a review from MarshallOfSound September 25, 2026 16:42
@trop trop Bot added 45-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Sep 25, 2026
@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) September 25, 2026 16:55
@MarshallOfSound
MarshallOfSound merged commit dc436bb into 45-x-y Sep 25, 2026
90 checks passed
@MarshallOfSound
MarshallOfSound deleted the trop/45-x-y-bp-fix-report-the-system-accent-colour-consistently-on-windows-1790354525741 branch September 25, 2026 19:07
@release-clerk

release-clerk Bot commented Sep 25, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed accent-color-changed on Windows reporting a colour that differed from systemPreferences.getAccentColor().

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

Labels

45-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant