Make main window border follow the system accent color setting#5174
Merged
Gabriel Dufresne (GabrielDuf) merged 2 commits intoJul 22, 2026
Merged
Conversation
4 tasks
Copilot started reviewing on behalf of
Gabriel Dufresne (GabrielDuf)
July 22, 2026 15:51
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the main window border to follow Windows 11 accent-color preferences and react to system changes.
Changes:
- Reads DWM accent settings with a neutral theme fallback.
- Reapplies border colors after theme or DWM setting changes.
- Adds registry-access interop.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Marc-André Moreau (mamoreau-devolutions)
approved these changes
Jul 22, 2026
Gabriel Dufresne (GabrielDuf)
deleted the
fix/window-border-follow-accent-color
branch
July 22, 2026 18:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request enhances the window border color handling in
MainWindow.axaml.csto better match Windows 11 system accent and theme changes. The code now reads Windows DWM registry values to use the system accent color for the window border when enabled, and ensures the border color updates dynamically in response to system color or theme changes.Window border color improvements:
ApplyWindowBorderColormethod now attempts to read theColorPrevalenceandAccentColorvalues from the Windows DWM registry. If accent color is enabled, it uses the system accent color for the window border; otherwise, it falls back to the per-theme neutral color.TryReadDwmDwordhelper method to safely read DWORD values from the registry.RegGetValueW, constants, andHKEY_CURRENT_USER) in theNativeMethodsclass.Dynamic update on system changes:
WM_DWMCOLORIZATIONCOLORCHANGEDandWM_SETTINGCHANGEmessages, and reapplies the border color when these occur, ensuring the border stays in sync with system changes.Code cleanup: