Skip to content

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented Aug 15, 2025

Description of Change

Closes #48086
Closes https://github.com/electron/electron/issues
Refs #47741.

Fixes an issue where the accent color would be accidentally inverted when set to match the system color. This could be seen if you chose e.g. an orange, whose color opposite is blue; the window would have a blue border in that case. This happened because DwmGetColorizationColor returns a color formatted 0xAARRGGBB, and the parsing performed here used Get{R|G|B}Value to parse the color into a COLORREF. From documentation:

The value pointed to by pcrColorization is in an 0xAARRGGBB format. Many Microsoft Win32 APIs, such as COLORREF, use a 0x00BBGGRR format. Be careful to assure that the intended colors are used.

Switch to pulling the color from the windows registry, which does not require extra conversion to ensure the color is in the right format.

cc @bpasero

Tested to ensure the color updates correctly with settings change.

Checklist

Release Notes

Notes: Fixes an issue where the accent color would be accidentally inverted when set to match the system color.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Aug 15, 2025
@codebytere codebytere added semver/patch backwards-compatible bug fixes target/36-x-y PR should also be added to the "36-x-y" branch. 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. labels Aug 15, 2025
@codebytere codebytere force-pushed the fix-system-accent-color branch from 60b1ede to 73584b7 Compare August 15, 2025 11:09
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Aug 16, 2025
@codebytere codebytere requested a review from jkleinsc August 18, 2025 08:01
@codebytere codebytere merged commit 13d955a into main Aug 19, 2025
150 of 153 checks passed
@codebytere codebytere deleted the fix-system-accent-color branch August 19, 2025 08:01
@release-clerk
Copy link

release-clerk bot commented Aug 19, 2025

Release Notes Persisted

Fixes an issue where the accent color would be accidentally inverted when set to match the system color.

@trop
Copy link
Contributor

trop bot commented Aug 19, 2025

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

@trop
Copy link
Contributor

trop bot commented Aug 19, 2025

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

@trop
Copy link
Contributor

trop bot commented Aug 19, 2025

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

@trop trop bot added in-flight/38-x-y in-flight/36-x-y and removed 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/36-x-y PR should also be added to the "36-x-y" branch. in-flight/37-x-y labels Aug 19, 2025
@trop trop bot added 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/36-x-y PR was merged to the "36-x-y" branch. and removed in-flight/38-x-y in-flight/36-x-y labels Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged/36-x-y PR was merged to the "36-x-y" branch. 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. semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting accent color mixes up the hex values
2 participants