Skip to content

Fix macOS accent color not respecting the current theme - #22143

Merged
MrJul merged 1 commit into
AvaloniaUI:mainfrom
MrJul:fix/macos-accent-color
Sep 4, 2026
Merged

Fix macOS accent color not respecting the current theme#22143
MrJul merged 1 commit into
AvaloniaUI:mainfrom
MrJul:fix/macos-accent-color

Conversation

@MrJul

@MrJul MrJul commented Sep 4, 2026

Copy link
Copy Markdown
Member

What does the pull request do?

This PR fixes the accent color reported for macOS being incorrect after a system appearance (theme) change.

It turns out the accent color is slightly different between the light and dark theme, so this can easily be missed.
For example, the color of the Purple accent is #A550A7 on the dark theme, but #953D96 on the light one.

What is the current behavior?

The accent color is always reported with the system appearance that was used when the application started.
Note that accent color changes are reported and read, but the actual value isn't correct.

What is the updated/expected behavior with this PR?

The reported accent color matches the current appearance.

How was the solution implemented (if it's not obvious)?

NSColor.controlAccentColor uses the currentDrawingAppearance, which is a thread-local value that might not correspond to the actual system appearance. NSApp.effectiveAppearance is now forced as the current drawing appearance before retrieving the value.

@MrJul MrJul added bug os-macos customer-priority Issue reported by a customer with a support agreement. backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch labels Sep 4, 2026
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.2.999-cibuild0069402-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul
MrJul added this pull request to the merge queue Sep 4, 2026
Merged via the queue into AvaloniaUI:main with commit 380bd8a Sep 4, 2026
10 checks passed
@MrJul
MrJul deleted the fix/macos-accent-color branch September 4, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch bug customer-priority Issue reported by a customer with a support agreement. os-macos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants