Files
StarterNG/StarterNG/Infrastructure/WindowSurfaces.cs
maj00r f9939fd566 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.
2026-11-25 17:56:28 +01:00

22 lines
865 B
C#

using Avalonia;
namespace StarterNG.Infrastructure;
/// <summary>
/// On Windows the graphics card draws each window of the starter into a surface of that
/// window, not into Avalonia's default WinUI composition visual. On Windows 11 25H2 that
/// visual was left empty on many starts: the main window, or a dialog opened later,
/// stayed black while the others drew, and came back only now and then. Composition is
/// there for see-through windows and backdrops, and the starter has none.
/// <see cref="SoftwareRender"/> goes after this and brings its own options.
/// </summary>
public static class WindowSurfaces
{
public static Win32PlatformOptions Win32Options => new()
{
CompositionMode = new[] { Win32CompositionMode.RedirectionSurface }
};
public static AppBuilder ApplyTo(AppBuilder builder) => builder.With(Win32Options);
}