Skip to content

fix(win32): Make SystemBackdrop work and stop rewriting app backgrounds - #24190

Merged
MartinZikmund merged 23 commits into
masterfrom
dev/mazi/window-background
Sep 29, 2026
Merged

MartinZikmund merged 23 commits into
masterfrom
dev/mazi/window-background

Conversation

@MartinZikmund

@MartinZikmund MartinZikmund commented Aug 25, 2026 •

Copy link
Copy Markdown
Member

GitHub Issue: closes #24189

PR Type:

🐞 Bugfix

What changed? 🚀

Window.SystemBackdrop was broken several ways on Skia Win32. The table below was measured on a real
window's client-area centre pixel (screen capture with an occlusion guard, Windows 11 26100, desktop
in dark theme), against a stock WinAppSDK 2.4.0 app doing the same thing.

Measurement caveat: these pixels were captured on an earlier revision of this PR that also
swapped Vulkan for OpenGL under a backdrop (see item 1). That swap has since been removed, and the
table has not yet been re-captured on the current head.

Case Before After WinUI 3
Mica, dark #000000 #231F1D #211F21
Mica, light #000000 #F8F1F2 #F5F1F7
Acrylic, dark #000000 #3A3A3A #2C2C2C
Mica + app Grid painted red material, app value lost #FF0000 #FF0000
No backdrop, light / dark #FFFFFF / #000000 unchanged #FFFFFF / #000000

1. The renderer is unchanged

An earlier revision downgraded Vulkan to OpenGL whenever a backdrop was attached, and rebuilt the
renderer when one was attached or removed on a live window. That was dropped in
fix(win32): Keep Vulkan under a system backdrop: measured on Windows 11 (RTX 4090, NVIDIA 610.88),
Mica renders the same under Vulkan and OpenGL, whether the backdrop is attached before or after the
window is shown. Win32WindowWrapper still picks its renderer once, at construction, with no backdrop
condition, so there is no renderer-switch path in this PR.

2. The framework rewrote the application's own backgrounds

Setting a backdrop walked the entire visual tree and replaced Background on every Panel,
Border, ContentPresenter, and Control holding an opaque SolidColorBrush, re-walking on every
Loaded and keeping Loaded/Unloaded subscriptions on every element it visited. It was observable
from app code — a Grid explicitly painted red read back as Transparent — and because the brush
was written with Local precedence, any {ThemeResource} background it touched stopped re-resolving
on theme change.

MUX instead flips one flag on the island root (CXamlIslandRoot::SetHasTransparentBackground, from
DesktopWindowImpl::SetXamlIslandRootBackground) and the render walk skips that one element's
background primitive (BaseContentRenderer::PanelRenderContent). Panel.Background keeps its theme
brush throughout; app content is never touched.

This ports the same flag onto XamlIslandRoot, suppresses the background push in
BorderHelper.UpdateBackground — Uno's equivalent of the MUX render walk — and deletes the traversal
and its eight helpers. 166 lines removed.

3. The material's tint followed the desktop theme

DWMWA_USE_IMMERSIVE_DARK_MODE was set from GetSystemTheme(), so an app running light on a dark
desktop got a dark material. MUX drives SystemBackdropConfiguration.Theme from
XamlRoot.Content.ActualTheme (SystemBackdrop_Partial.cpp). It now follows the content's
ActualTheme, falling back to Application.RequestedTheme before content exists, and re-applies when
either the content theme or the desktop theme changes.

Worth a reviewer's eye: DWM exposes a single per-window flag for both the material tint and the
caption colour, so the caption follows too. Measured, WinUI's caption is #F2F2F9 (light) in
both themes, because WinUI never opts a window into DWM dark mode at all. Uno previously followed
the desktop; it now follows the app. Light-themed apps therefore match WinUI, and dark-themed apps
get a dark caption where WinUI shows a light one.

4. Two formulas computed the same root background

Construction seeded the root from a high-contrast-blind White/Black helper, while every theme
change re-applied the high-contrast-aware FrameworkTheming.GetHwndBackground(Theme.None). A
high-contrast app therefore started with plain white or black under its content and only converged at
the first theme notification. MUX has no such split — CXamlIslandRoot::NotifyThemeChangedCore is
called from InitializeCommon() and from every CCoreServices::NotifyThemeChange. Both seed points
now use FrameworkTheming, and the second formula is gone.

5. The backdrop theme follows the window's content, including when it is replaced

MUX's SystemBackdrop uses XamlRoot.Content.ActualTheme as its theme source, and moves that
subscription to the new content on XamlRoot.Changed (SystemBackdrop_Partial.cpp,
OnXamlRootChanged). Uno now does the same. Window raises an internal ContentChanged when
Content is replaced or cleared, and two consumers use it:

  • The Win32 DWM caption and material tint moves to the new content. Clearing Content drops the
    subscription instead of keeping the old element alive.
  • On heads that render no material, the fallback background resolves
    ApplicationPageBackgroundThemeBrush under the content's theme instead of the application's, and
    refreshes when that theme changes or the content is replaced.

6. Backdrop edge cases

  • A backdrop set before the native window exists (a Window created before
    Application.InitializationCompleted) is now replayed to the native window once it is initialized.
    Before, it never reached DWM.
  • On Win32, a backdrop type the head cannot render now clears the DWM backdrop (DWMSBT_NONE) and
    shows the fallback, the same as macOS. Before, the previous material stayed under the frame while
    the root painted opaque.

Not changed on purpose

The no-backdrop case was already correct and is untouched. WinUI paints the underlying window
background pure #FFFFFF / #000000 — not ApplicationPageBackgroundThemeBrush
(#F3F3F3/#202020) — from a hardcoded brush on CXamlIslandRoot's Panel.Background, and Uno
already did exactly that on the same element. Verified for Grid, Page, Border, UserControl, a
transparent Grid, and Content = null.

No framework-side fallback colour was added either: with transparency effects off, DWM itself falls
back to #F3F3F3 / #202020, precisely WinUI's SolidBackgroundFillColorBase.

Validation

  • Runtime, pixels — every row of the table above, captured from real windows on the default
    renderer configuration, re-verified after rebasing onto feature/breakingchanges.
  • Runtime, tests — the two new runtime tests pass. Both host their content on the main window and
    clear it afterwards.
  • Unit tests — Given_Window_SystemBackdrop checks the colour the root actually renders, not just
    its mode. It covers the fallback following the content's RequestedTheme and a replaced
    Window.Content.
  • Regression — a targeted suite over the code this touches (Border, Grid, UserControl and five
    theming classes, 266 tests) gives 260 passed / 5 failed / 1 inconclusive. The same filter on the
    unmodified baseline gives the identical result with the same five names — DPI layout-rounding
    assertions (27 vs 27.2, 145 vs 144.8) and one GC-collection timing test. No regressions.
    Given_ContentPresenter, which exercises the changed background path heavily, passes 270/270.

Unrelated pre-existing issue found while running these, filed separately for visibility: on Skia
Win32 any test run that closes a secondary window or popup dies with an access violation in
SKSurface's finalizer before the results file is written. It reproduces identically on an
unmodified baseline build, and it is why the new tests host their content on the main window.

PR Checklist ✅

Breaking change

Content backgrounds are no longer made transparent when a SystemBackdrop is set.

An app that relied on the framework doing this will now see its own opaque backgrounds hide the
material. The migration is the one-line change WinUI has always required — make the surface you want
the material to show through transparent yourself:

<Page Background="Transparent">

Documented in doc/articles/migrating-to-uno-7.md (new "SystemBackdrop no longer rewrites your
content's backgrounds" section plus a migration-checklist entry), and
doc/articles/features/system-backdrop.md has been corrected — it previously claimed the SamplesApp
test performed the traversal, when the framework was doing it.

Copilot AI lite review requested due to automatic review settings August 25, 2026 07:17
@github-actions github-actions Bot added area/automation Categorizes an issue or PR as relevant to project automation kind/documentation labels Aug 25, 2026
@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 6m 12s —— View job


Review: fix(win32): Make SystemBackdrop work and stop rewriting app backgrounds

Verdict: fix-first (two medium findings; low findings can follow in a subsequent commit)

Summary

The three root-cause fixes — swapping the renderer for Vulkan bypass, replacing the tree-walk with a single island-root flag, and driving DWM dark mode from content's ActualTheme — are correct and well-structured. The 166-line deletion of the traversal machinery is clean, and the BorderHelper/XamlIslandRoot flag approach is a faithful port of the MUX model. CoreServices and UnoRootElementLogic unification (seeding from one formula) is a nice catch.

Issues by severity

# Severity Location Title
1 Medium Win32WindowWrapper.cs:939 CreateRenderer() has a hidden field-mutation side effect
2 Medium Win32WindowWrapper.cs:187 UpdateFrameTheme() subscription not re-established when Window.Content changes at runtime
3 Low Given_Window.cs:178 Missing [GitHubWorkItem] on new runtime tests
4 Low Given_Window.cs:226 Backdrop test asserts "unsupported" no-op on non-Win32 Skia targets — consider [PlatformCondition] or a comment

Cross-cutting notes

  • HasActiveSystemBackdrop() (OverlappedPresenter) and IsBackdropSupported() (Window) duplicate the same MicaController.IsSupported() / DesktopAcrylicController.IsSupported() switch. This isn't a bug (they live in different layers), but a shared IsBackdropActiveAndSupported(SystemBackdrop?) helper on the Win32 side would eliminate the duplication.
  • Docs and migration guide: Both updated files are accurate and the migration example (<Page Background="Transparent">) is the right one-line fix. No issues there.
  • Code style, braces, event types, platform file suffixes: all correct.
  • ThemingHelper.GetRootVisualBackground() removal + UnoRootElementLogic simplification: clean; the unified seeding path via coreServices.Theming.GetRootVisualBackground() is the correct fix for the high-contrast-blind split.

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 230019 has failed on Uno.UI - docs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Skia Win32 SystemBackdrop rendering, preserves application backgrounds, synchronizes themes, and updates tests and documentation.

Changes:

  • Switches backdrop windows from Vulkan to compatible renderers.
  • Uses island-root transparency instead of rewriting app backgrounds.
  • Adds theme synchronization and runtime coverage.
  • Updates samples and migration documentation.

Unresolved moderate findings remain in backdrop lifecycle handling, shared renderer state, test cleanup, and unsupported backdrop handling.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Summary
src/Uno.UI/UI/Xaml/Window/Window.cs Manages backdrop state and root transparency.
src/Uno.UI/UI/Xaml/ThemingHelper.cs Supports themed background handling.
src/Uno.UI/UI/Xaml/Internal/UnoRootElementLogic.cs Updates root-element behavior.
src/Uno.UI/UI/Xaml/Internal/Islands/XamlIslandRoot.Core.cs Stores island transparency and initializes backgrounds.
src/Uno.UI/UI/Xaml/Internal/CoreServices.cs Initializes themed root backgrounds.
src/Uno.UI/UI/Xaml/BorderHelper.cs Suppresses only the island root background primitive.
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_Window.cs Adds backdrop regression coverage; cleanup requires changes.
src/Uno.UI.Runtime.Skia.Win32/UI/Xaml/Window/Win32WindowWrapper.cs Handles renderer and DWM theme integration; lifecycle and shared-state issues remain.
src/SamplesApp/SamplesApp.Samples/Microsoft/UI/Windowing/MicaBackdropTests.xaml.cs Updates backdrop sample behavior.
src/SamplesApp/SamplesApp.Samples/Microsoft/UI/Windowing/MicaBackdropTests.xaml Updates sample UI for transparent content.
doc/articles/migrating-to-uno-7.md Documents the breaking background behavior change.
doc/articles/features/system-backdrop.md Corrects SystemBackdrop guidance.
Suppressed comments (7)

src/SamplesApp/SamplesApp.Samples/Microsoft/UI/Windowing/MicaBackdropTests.xaml.cs:18

  • The SetBackdrop method later in this file still says that the framework “transparentizes the visual tree.” That statement is now false and contradicts this updated sample guidance, so update or remove the stale comment to avoid directing future changes toward the deleted traversal.
		"Setting a backdrop drops the window's own root background; app content keeps its own, so this page sets Background=\"Transparent\". " +

src/Uno.UI.Runtime.Skia.Win32/UI/Xaml/Window/Win32WindowWrapper.cs:975

  • This can run on every active/inactive backdrop transition. With the default Vulkan renderer, the first attach creates OpenGL and assigns the HWND's pixel format; clearing the backdrop recreates Vulkan, and a later attach attempts to assign the pixel format again. Win32 pixel formats are immutable per HWND, so OpenGL creation then fails and the fallback silently downgrades the window to software. Reuse the existing pixel format when rebuilding OpenGL or retain a renderer/context that avoids reassigning it.
		_renderer = CreateRenderer();

src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_Window.cs:240

  • This test also leaves its red Grid attached to the main window. Since CleanupTest does not clear main-window content and the headless runner retains it, the loaded tree can leak into subsequent runtime tests; clear WindowHelper.WindowContent in the existing finally block.
			window.SystemBackdrop = previousBackdrop;

src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_Window.cs:178

  • This new regression test directly covers issue #24189, but it has no GitHubWorkItem link. Add [GitHubWorkItem("https://github.com/unoplatform/uno/issues/24189")] so the test remains traceable to the behavior it guards.
	[TestMethod]

src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_Window.cs:213

  • The second new regression test also directly covers issue #24189 but lacks the issue annotation. Add the same GitHubWorkItem attribute here (or use a narrowly scoped shared annotation) so both guards are discoverable from the issue.
	[RunsOnUIThread]

src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_Window.cs:227

  • The new test exercises setting a backdrop but only asserts the content brush. The reported Vulkan regression (a black client area) would still pass if renderer selection or DWM composition regressed; add a Skia Win32 render/pixel assertion, or another assertion that proves the non-Vulkan path is active.
			window.SystemBackdrop = new MicaBackdrop();
			await TestServices.WindowHelper.WaitForIdle();

src/Uno.UI/UI/Xaml/Window/Window.cs:437

  • This new helper only updates the managed root flag, but it does not address the case where SystemBackdrop was assigned before Window.Initialize(): the setter then saw no NativeWrapper, so no DWM attribute was sent. Initialization later creates the Win32 wrapper and selects a non-Vulkan renderer from the stored property, but never replays SetSystemBackdrop, leaving DWM at DWMSBT_NONE and the material absent. Reapply the pending native backdrop when the wrapper is created.
	private void UpdateRootVisualBackgroundForBackdrop(Media.SystemBackdrop? backdrop)
	{
		if (RootElement is Uno.UI.Xaml.Islands.XamlIslandRoot islandRoot)
		{
			islandRoot.SetHasTransparentBackground(backdrop is not null && IsBackdropSupported(backdrop));
		}

Comment thread src/Uno.UI/UI/Xaml/Window/Window.cs Resolved
@nventive-devops

Copy link
Copy Markdown
Contributor

The build 230018 found UI Test snapshots differences: skia-linux-screenshots: 73, skia-windows-screenshots: 123

Details
  • skia-linux-screenshots: 73 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DynamicFont.png
    • Buttons.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ContextRequested.png-dark
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • Focus_FocusVisual_Properties.png-dark
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • ImageBrush_Stretch.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • ContentControl_Inheritance.png
  • skia-windows-screenshots: 123 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Attributed_text_FontSize_Changing.png-dark
    • ExpanderColorValidationPage.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • Haptics.VibrationDevice.png-dark
    • Haptics.VibrationDevice.png
    • Battery.png-dark
    • DataTransferManager.png-dark
    • DataTransferManager.png
    • EmailManagerTests.png-dark
    • EmailManagerTests.png
    • GeolocatorPositionChanged.png-dark
    • GeolocatorPositionChanged.png
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • Attributed_text_FontSize_Changing.png
    • Contacts_Pick.png-dark

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 230018 has failed on Uno.UI - CI.

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/window-background branch from b4c41db to 6c4e984 Compare August 29, 2026 15:06
@github-actions

github-actions Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 231039 has failed on Uno.UI - docs.

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 231038 found UI Test snapshots differences: skia-linux-screenshots: 73, skia-windows-screenshots: 123

Details
  • skia-linux-screenshots: 73 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Buttons.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • DropDownButtonPage.png-dark
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • ContextRequested.png-dark
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • ImageBrush_Stretch.png
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Image_Margin_Large.png
    • Image_AnimatedWebP.png-dark
    • ImageBrushInList.png-dark
  • skia-windows-screenshots: 123 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Battery.png
    • DataTransferManager.png-dark
    • DataTransferManager.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Examples.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • EmailManagerTests.png-dark
    • EmailManagerTests.png
    • Buttons.png-dark
    • DropDownButtonPage.png-dark
    • ExpanderColorValidationPage.png-dark
    • ImageSourceUrlMsAppDataScheme.png-dark
    • ImageSourceUrlMsAppDataScheme.png
    • Attributed_text_FontSize_Changing.png

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 231038 has failed on Uno.UI - CI.

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/window-background branch from 6c4e984 to bfb1f4f Compare August 31, 2026 14:55
@github-actions github-actions Bot added the platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform label Aug 31, 2026
@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 231186 has failed on Uno.UI - docs.

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 231185 found UI Test snapshots differences: skia-linux-screenshots: 73, skia-windows-screenshots: 123

Details
  • skia-linux-screenshots: 73 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Buttons.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Focus_FocusVisual_Properties.png-dark
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DropDownButtonPage.png-dark
    • DynamicFont.png
    • ContextRequested.png-dark
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • ImageBrush_Stretch.png
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
  • skia-windows-screenshots: 123 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • GeolocatorPositionChanged.png-dark
    • GeolocatorPositionChanged.png
    • Battery.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Haptics.VibrationDevice.png-dark
    • Haptics.VibrationDevice.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • Attributed_text_FontSize_Changing.png
    • ContentPresenter_Template.png-dark
    • ContentPresenter_Template.png
    • DisplayInformation.png-dark
    • Dopes.png-dark
    • ExpanderColorValidationPage.png-dark
    • ImageSourceUrlMsAppDataScheme.png-dark
    • ImageSourceUrlMsAppDataScheme.png
    • Battery.png-dark
    • ButtonClippingTestsControl.png-dark

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 231185 has failed on Uno.UI - CI.

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/window-background branch from bfb1f4f to 18b1278 Compare August 31, 2026 15:56
@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 231202 found UI Test snapshots differences: skia-linux-screenshots: 73, skia-windows-screenshots: 123

Details
  • skia-linux-screenshots: 73 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ContentControl_Inheritance.png
    • ContextRequested.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Focus_FocusVisual_Properties.png-dark
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • Attributed_text_FontSize_Changing.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • DropDownButtonPage.png-dark
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • ImageBrush_Stretch.png
    • CalendarView_Theming.png-dark
  • skia-windows-screenshots: 123 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Battery.png-dark
    • Battery.png
    • CalendarView_Theming.png-dark
    • DropDownButtonPage.png-dark
    • Attributed_text_FontSize_Changing.png
    • Contacts_Pick.png
    • Attributed_text_FontSize_Changing.png-dark
    • Haptics.VibrationDevice.png-dark
    • Haptics.VibrationDevice.png
    • ContentPresenter_Template.png-dark
    • ContentPresenter_Template.png
    • DataTransferManager.png-dark
    • DataTransferManager.png
    • GeolocatorPositionChanged.png-dark
    • GeolocatorPositionChanged.png
    • DisplayInformation.png-dark
    • Dopes.png-dark
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • EmailManagerTests.png-dark

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 231203 has failed on Uno.UI - docs.

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/window-background branch from 41f25f9 to 5a4a5a6 Compare September 29, 2026 07:49
@MartinZikmund

Copy link
Copy Markdown
Member Author

🤖 Addressed PR comments up to this point

Rebased onto latest master (clean, no conflicts; strict build of Uno.UI + Skia Win32 runtime green) - now at 5a4a5a6.

  • @morning4coffe-dev (Approve): no further action needed - all review threads were already resolved.
  • nventive-devops screenshot diffs: informational, no code change.
  • Mergify backport requests for release/stable/6.7 / servicing/6.8 remain queued for merge time.

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 1m 16s —— View job


Review: fix(win32): Make SystemBackdrop work and stop rewriting app backgrounds

Verdict: ship (no new findings — no code changes since the last review round)

  • Gather context (prior review rounds, PR history)
  • Diff current HEAD against origin/master / last-reviewed state
  • Review changed files against AGENTS.md checklist
  • Post inline findings (none needed)
  • Post summary

What changed since the last review round

Nothing. Current HEAD (5a4a5a62) is exactly the same two commits already reviewed and given a ship verdict on 2026-09-25T22:28:27Z (referenced there as 41f25f93/ddcae7a11b7/a76cecc167e — same content under different hashes, a pattern already seen elsewhere in this PR's history after force-pushes):

  • fix(window): Raise ContentChanged for secondary-ALC content (56a1e36d) — adds OnContentChanged(); to the secondary-ALC success branch of the Content setter (Window.cs:233), confirmed present at src/Uno.UI/UI/Xaml/Window/Window.cs:233.
  • test(window): Cover ContentChanged for secondary-ALC content (5a4a5a62) — adds When_AlcWindow_ContentSet_Then_ContentChangedRaised to Given_AlcContentHost.cs, confirmed present and unchanged.

This synchronize event was triggered with no new commits landing on the branch (git status shows the branch up to date with origin/dev/mazi/window-background, working tree clean).

Re-verified against AGENTS.md

  • internal event EventHandler? ContentChanged uses EventHandler, not event Action — compliant with the events rule.
  • The fix closes the gap flagged across three prior rounds (bot + Copilot, 2026-09-18): the secondary-ALC branch now raises ContentChanged so Win32WindowWrapper.UpdateFrameTheme() and Window.UpdateBackdropThemeSource() stay in sync with the actually-hosted content.
  • The new test asserts both the fire-count (1) and that Content already reflects the hosted value when the event fires — a real regression guard.
  • All findings from the eight prior review rounds (content lifecycle retargeting, pending-backdrop replay, unsupported-backdrop DWM clearing, unit-test assertions/indentation, [GitHubWorkItem] links, WindowHelper.WindowContent cleanup, PR description reconciled with the shipped renderer code) remain resolved, and this PR already carries a human approval (@morning4coffe-dev, 2026-09-24T19:04:55Z) on this exact content.

Nothing further to flag from a code-review standpoint.
· branch dev/mazi/window-background

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 236166 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 289, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • Buttons.png-dark
    • Buttons.png
    • ClipboardTests.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • Examples.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • DisplayInformation.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Focus_FocusVisual_Properties.png-dark
    • ImageIconPage.png-dark
  • skia-windows-screenshots: 289 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AutomationProperties_AutomationId.png-dark
    • AutomationPropertiesExtensions_Role.png-dark
    • AutomationPropertiesExtensions_Role.png
    • Battery.png-dark
    • Battery.png
    • Contacts_Pick.png-dark
    • Contacts_Pick.png
    • ContentPresenter_NativeEmbedding_ZIndex.png
    • AuthenticationBroker_Demo.png-dark
    • AutomationProperties_Name.png
    • Accessibility_ScreenReader.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • CompositionPath.png-dark
    • CompositionPath.png
    • ElevatedViewTests.png-dark
    • ElevatedViewTests.png
    • ElevatedView_BorderThickness.png-dark
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • UITests.Uno_Web.Http.CookieManagerTests
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 236167 has failed on Uno.UI - docs.

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 46s —— View job


Review: fix(win32): Make SystemBackdrop work and stop rewriting app backgrounds

Verdict: ship (no new findings — trivial docs-only change)

  • Gather context (prior review rounds, PR history)
  • Diff current HEAD against last-reviewed commit
  • Review changed files against AGENTS.md checklist
  • Post inline findings (none needed)
  • Post summary

What changed since the last review round

One commit, 3a9c7cbd ("docs: Renumber the 7.0 migration checklist"), landed after the previous ship verdict (2026-09-29T07:50:09Z, on 5a4a5a62). It's a pure documentation fix: doc/articles/migrating-to-uno-7.md had two list items both numbered 18. (the pre-existing "Re-baseline visual/snapshot tests..." item and this PR's new "On iOS/tvOS, call MigrateSettings()..." item); this commit renumbers the latter to 19.. Verified the full numbered sequence in that section now runs 1–19 with no duplicates or gaps. No code changes, no functional impact.

Re-confirmed state

No code changed in this delta, so all prior findings remain resolved as previously verified: content-lifecycle retargeting (including the secondary-ALC ContentChanged gap fixed in 56a1e36d/5a4a5a62), pending-backdrop replay, unsupported-backdrop DWM clearing, unit-test assertions/indentation, [GitHubWorkItem] links, WindowHelper.WindowContent cleanup, and the PR description's reconciliation with the shipped renderer code (no Vulkan-bypass swap). This PR already carries a human approval (@morning4coffe-dev, 2026-09-24T19:04:55Z).

Nothing further to flag from a code-review standpoint.
· branch dev/mazi/window-background

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 236166 has failed on Uno.UI - CI.

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 236173 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 2310, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Buttons.png-dark
    • Buttons.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • DisplayInformation.png-dark
    • ContextRequested.png-dark
    • ContextRequested.png
    • Examples.png-dark
    • DropDownButtonPage.png-dark
    • Examples.png
    • DropDownButtonPage.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • ImageIconPage.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Gamepad_CurrentReading.png-dark
  • skia-windows-screenshots: 2310 changed over 2502

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AndroidWindowInsets.png-dark
    • AppBarToggleButtonTest.png
    • ApplicationViewSpanningRectsPage.png
    • AppWindowTitleBar Properties.png-dark
    • Arrange_Performance01.png
    • Attributed_text_Supserscript.png-dark
    • AutoBorderStretchwithleftmargin.png-dark
    • AutomationProperties_Name.png-dark
    • AutoSuggestBoxChosenSuggestion.png-dark
    • AutoSuggestBoxChosenSuggestion.png
    • BadgeNotificationTests.png-dark
    • BadgeNotificationTests.png
    • BeginTime_MultipleAnimations.png-dark
    • BeginTime_MultipleAnimations.png
    • BitmapImage_vs_SvgImageSource.png-dark
    • BitmapImage_vs_SvgImageSource.png
    • BorderLeftwithmargins.png-dark
    • BorderLeftwithmargins.png
    • BorderVersusPanelClipping.png-dark
    • BorderVersusPanelClipping.png
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • UITests.Uno_Web.Http.CookieManagerTests
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation

Comment thread src/Uno.UI/UI/Xaml/Window/Window.cs Resolved
@MartinZikmund
MartinZikmund merged commit 8904ff3 into master Sep 29, 2026
58 checks passed
@MartinZikmund
MartinZikmund deleted the dev/mazi/window-background branch September 29, 2026 10:16
MartinZikmund added a commit that referenced this pull request Oct 9, 2026
On a hybrid-GPU laptop, Window.SystemBackdrop showed Mica or Acrylic only
under the non-client frame; the client area stayed opaque black. Vulkan
device selection always preferred the discrete GPU, and on such a machine
the discrete GPU usually drives no display: its swapchain reaches the
screen through a cross-adapter copy that drops the alpha DWM needs to show
the material through the client area. The same app shows the material when
Vulkan runs on the integrated GPU that scans the panel out (verified with
VK_LOADER_DRIVERS_SELECT on stock binaries), and on a desktop whose
discrete GPU drives the monitor directly, as measured in #24190.

Prefer the physical device whose VkPhysicalDeviceIDProperties.deviceLUID
matches the adapter driving the window's monitor (QueryDisplayConfig source
path for MonitorFromWindow), falling back to the previous discrete-first
order when no LUID matches or the platform doesn't report one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LP133TsLEXjMo7XFGmakoS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/automation Categorizes an issue or PR as relevant to project automation area/skia ✏️ Categorizes an issue or PR as relevant to Skia kind/documentation platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

6 participants