Skip to content

[Skia Win32] SystemBackdrop renders a black window, overwrites app backgrounds, and follows the desktop theme #24189

Closed

Description

@MartinZikmund

Current behavior 🐛

On Skia Win32, Window.SystemBackdrop is broken in three distinct ways. All numbers below are the
client-area centre pixel of a real window, screen-captured with an occlusion guard, on Windows 11
26100 with the desktop in dark theme. WinUI 3 numbers come from a stock WinAppSDK 2.4.0 app doing
exactly the same thing.

1. The material never appears — the window is solid black.

FeatureConfiguration.Rendering.UseVulkanOnWin32 defaults to true, so this is what apps get out
of the box.

Uno WinUI 3
MicaBackdrop, dark #000000 #202020
MicaBackdrop, light #000000 #F5F1F7
DesktopAcrylicBackdrop, dark #000000 #2C2C2C

Vulkan presents through a swapchain bound directly to the HWND, which bypasses the window's
redirection surface — the surface DWM composites against the frame extended by
DwmExtendFrameIntoClientArea. The transparent client area the framework produces for a backdrop is
therefore composited as opaque. Forcing the OpenGL or software renderer shows the material
correctly, which is how the cause was isolated.

2. The framework overwrites the application's own Background values.

Setting a backdrop walks the whole visual tree and replaces Background on every Panel, Border,
ContentPresenter, and Control that holds an opaque SolidColorBrush, re-walking on every
Loaded. This is observable from app code, not just on screen:

var grid = new Grid { Background = new SolidColorBrush(Colors.Red) };
window.Content = grid;
window.SystemBackdrop = new MicaBackdrop();

// Uno:   grid.Background is SolidColorBrush #00FFFFFF  (the app's value is gone)
// WinUI: grid.Background is SolidColorBrush #FFFF0000  (untouched; the Grid hides the material)

Because the replacement brush is written with Local precedence, any background that was bound with
{ThemeResource} also stops re-resolving on a theme change.

3. The material's tint follows the desktop theme instead of the app's.

An app running light on a dark desktop gets a dark material. WinUI drives
SystemBackdropConfiguration.Theme from XamlRoot.Content.ActualTheme, so it shows a light one.
Uno sets DWMWA_USE_IMMERSIVE_DARK_MODE from SystemThemeHelper.GetSystemTheme().

There is also a smaller, related inconsistency in the same area: the window root's background colour
is computed by two different rules — a high-contrast-blind White/Black helper at construction,
and the high-contrast-aware FrameworkTheming.GetHwndBackground on every theme change — so a
high-contrast app starts with the wrong colour and only converges at the first theme notification.

Expected behavior 🎯

Match WinUI:

  • The requested material is visible with the default renderer configuration.
  • Application content keeps the Background values the app set. An opaque page legitimately hides
    the material, exactly as it does on Windows; only the window's own root background is dropped.
  • The material's tint follows the app's theme.

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

  1. Create an Uno app with a Skia Win32 (Desktop) head on Windows 11 build 22621 or later.

  2. Give the window content with no background of its own, e.g. <Grid />.

  3. Set a backdrop:

    MainWindow.SystemBackdrop = new Microsoft.UI.Xaml.Media.MicaBackdrop();
  4. Run. The window is solid black instead of showing Mica.

For issue 2, give the Grid an explicit Background="Red" and read grid.Background back after
setting the backdrop.

For issue 3, set RequestedTheme="Light" on the Application while the desktop is in dark mode and
compare the material against the same app built with WinUI.

Workaround 🛠️

For the black window, opt out of Vulkan before the host starts:

Uno.UI.FeatureConfiguration.Rendering.UseVulkanOnWin32 = false;

OpenGL and software rendering both composite the backdrop correctly.

There is no workaround for issues 2 and 3 from application code.

Renderer 🎨

  • Skia
  • Native

Affected platforms 📱💻🖥️

Desktop (Windows)

Uno.Sdk version (and other relevant versions) 📦

Reproduced against main/feature/breakingchanges sources (Uno 7.0 development), Windows 11 build
26100, on an NVIDIA RTX 4000 Ada Laptop GPU (driver 595.380). Compared against WinAppSDK 2.4.0.

IDE version 🧑‍💻

N/A — reproduced from the command line with a minimal Skia Win32 head.

Anything else we need to know? 💬

Two related observations from the same investigation, recorded here so they are not lost:

  • The no-backdrop case is already correct and should not be changed. WinUI paints the window's
    underlying background pure #FFFFFF (light) / #000000 (dark) — not
    ApplicationPageBackgroundThemeBrush (#F3F3F3/#202020) — from a hardcoded brush on
    CXamlIslandRoot's Panel.Background. Uno already matches this exactly, on the same element,
    for Grid, Page, Border, UserControl, a transparent Grid, and Content = null.
  • No framework-side fallback colour is needed when Windows declines the material. With
    transparency effects turned off, DWM itself falls back to #F3F3F3 (light) / #202020 (dark) —
    precisely WinUI's documented SolidBackgroundFillColorBase fallback.

Related but deliberately out of scope here: #21942 (theme-coloured background during resize, which
needs a WM_ERASEBKGND handler) and #14853 / #17275 (the full SystemBackdrop object model —
SystemBackdropConfiguration, ICompositionSupportsSystemBackdrop, and composition-drawn
materials).

Activity

  1. Jen-Uno commented on Sep 30, 2026

    @Jen-Uno
    Contributor

    QA: closing out without a manual pass. The fix in #24190 ships with automated tests (MicaBackdropTests.xaml, MicaBackdropTests.xaml.cs, Given_AlcContentHost.cs and 1 more) that exercise the change.

    If you still see this behaviour on a build that includes that PR, please reopen or comment here.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions