fix: windows of the starter no longer come up black on Windows 11 25H2 (#63)

* fix: windows of the starter no longer come up black on Windows 11 25H2

Avalonia composes each window through a WinUI composition visual by
default, and on 25H2 that visual was often left empty: the main window
or a dialog opened later stayed black while the others drew. The
starter has no see-through windows or backdrops, so every window now
draws into its own redirection surface, still on the graphics card.
--software-render comes after and keeps its own options.

* test: the choice between window surfaces and the processor is covered

The choice moves out of Program, which no test runs, into
WindowSurfaces, where both branches are tested. Sonar's quality gate
failed on the coverage of the new code.

---------

Co-authored-by: maj00r <maj00r@host>
This commit is contained in:
maj00r
2026-11-27 04:00:39 +01:00
committed by GitHub
parent 4f749ff576
commit 50ca332438
3 changed files with 60 additions and 1 deletions

View File

@@ -73,8 +73,9 @@ static class Program
};
}
// Without the switch the graphics card draws, into the window surfaces.
private static AppBuilder WithSoftwareRenderIfAsked(this AppBuilder builder) =>
_softwareRender ? SoftwareRender.ApplyTo(builder) : builder;
WindowSurfaces.ApplyTo(builder, _softwareRender);
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()