Skip to content

Win32/Skia: caption button colors (ButtonForegroundColor / dark title bar) ignored since engine 6.6.166 (Uno.Sdk 6.6.29+) #24065

Closed

Description

@mciepiela

Current behavior 🐛

On the Win32 (Skia) desktop target, when a window uses AppWindow.TitleBar.ExtendsContentIntoTitleBar = true
with a dark app theme, the system caption buttons (minimize / maximize / close) are painted in a dark
color that is invisible against the dark title bar background — even though
AppWindow.TitleBar.ButtonForegroundColor is explicitly set to white in code.

The buttons are still present and functional (draggable region, hit-testing, hover/press all work,
Snap Layout still triggers on hover over maximize) — only their paint color ignores the configured
ButtonForegroundColor.

This regressed between Uno engine build 6.5.153 (Uno.Sdk 6.5.31) and 6.6.166 (Uno.Sdk 6.6.29).
I bisected using the two closest stable Uno.Sdk NuGet releases I could find (there is no stable
Uno.Sdk release between 6.5.36 and 6.6.29 — the 6.6 line starts at .29), and confirmed the same
minimal repro project (attached) shows the bug on 6.6.29 and does not show it on 6.5.31.

Diff of the affected version range for reference:
6.5.153...6.6.166

I could not find a change to the caption-message-handling code itself
(TryHandleCustomCaptionMessage, Win32SystemThemeHelperExtension, any DWMWA_* calls — all
byte-identical between the two tags), but src/Uno.UI.Runtime.Skia.Win32/UI/Xaml/Window/Win32WindowWrapper.cs
did get a rendering-pipeline change in that range (render timer replaced by a new "frame pacer",
plus a new optional Vulkan renderer path via FeatureConfiguration.Rendering.UseVulkanOnWin32) —
flagging it as the most likely area to look at first, though I haven't proven causation.

Expected behavior 🎯

The caption buttons should be painted using the color configured via
AppWindow.TitleBar.ButtonForegroundColor (and the other Button*Color properties), matching the
behavior on Uno.Sdk 6.5.31 / engine 6.5.153.

How to reproduce it (as minimally and precisely as possible) 🔬

Minimal repro project attached (zip). It's an unmodified dotnet new unoapp (desktop-only) with a
few lines added to App.xaml.cs:

MainWindow.AppWindow.TitleBar.ExtendsContentIntoTitleBar = true;
MainWindow.AppWindow.TitleBar.ButtonBackgroundColor = Windows.UI.Color.FromArgb(0, 0, 0, 0);
MainWindow.AppWindow.TitleBar.ButtonInactiveBackgroundColor = Windows.UI.Color.FromArgb(0, 0, 0, 0);
MainWindow.AppWindow.TitleBar.ButtonForegroundColor = Windows.UI.Color.FromArgb(255, 255, 255, 255);

if (MainWindow.Content is FrameworkElement root)
{
    root.RequestedTheme = ElementTheme.Dark;
    root.Background = new SolidColorBrush(Windows.UI.Color.FromArgb(255, 0, 0, 0));
}

Steps:

  1. Unzip, dotnet restore TitleBarRepro/TitleBarRepro.csproj -r win-x64
  2. dotnet run --project TitleBarRepro/TitleBarRepro.csproj -f net10.0-desktop -r win-x64
  3. Look at the top-right corner: the minimize/maximize/close glyphs are dark-on-dark (nearly
    invisible) — global.json in the zip is currently pinned to Uno.Sdk 6.6.29.
  4. Edit global.json to "Uno.Sdk": "6.5.31", dotnet restore + dotnet run again: same code,
    buttons now render white as configured.

(Screenshots of both runs, cropped to the title bar, also attached.)

TitleBarRepro.zip

Image Image

Workaround 🛠️

None found for the color itself. We also tried calling
DwmSetWindowAttribute(hwnd, DWMWA_USE_IMMERSIVE_DARK_MODE, ...) on the real HWND (obtained via
reflection over the internal Win32NativeWindow.Hwnd, since
WinRT.Interop.WindowNative.GetWindowHandle returns a placeholder handle on this head) — it
succeeds (hr=0) but does not change the button glyph color either.

Renderer 🎨

  • Skia
  • Native

Affected platforms 📱💻🖥️

Desktop (Windows)

Uno.Sdk version (and other relevant versions) 📦

  • Broken: 6.6.29 (engine 6.6.166), also seen on 6.6.42
  • Last known good: 6.5.31 (engine 6.5.153)
  • .NET 10, net10.0-desktop, win-x64

IDE version 🧑‍💻

Not IDE-specific — reproduces from dotnet build/dotnet run on the CLI.

Anything else we need to know? 💬

Found while investigating a real report from a production app (custom title bar, dark theme) where
users on 6.6.x could no longer see the window controls in dark mode. Happy to help narrow this down
further (e.g. bisect the 6.6.0-dev.* prerelease series) if that's useful — let me know.

Activity

  1. added theissue type on Aug 13, 2026
  2. added
    triage/untriaged
    on Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage/untriaged

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions