mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-26 01:49:12 +01:00
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.
This commit is contained in:
31
StarterNG.Tests/WindowSurfacesTests.cs
Normal file
31
StarterNG.Tests/WindowSurfacesTests.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Avalonia;
|
||||
using StarterNG.Infrastructure;
|
||||
|
||||
namespace StarterNG.Tests;
|
||||
|
||||
public class WindowSurfacesTests
|
||||
{
|
||||
[Fact]
|
||||
public void Windows_draws_into_the_window_surface_and_never_through_winui_composition()
|
||||
{
|
||||
var options = WindowSurfaces.Win32Options;
|
||||
|
||||
Assert.Equal(new[] { Win32CompositionMode.RedirectionSurface }, options.CompositionMode);
|
||||
Assert.DoesNotContain(Win32CompositionMode.WinUIComposition, options.CompositionMode);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void The_graphics_card_still_draws()
|
||||
{
|
||||
Assert.Equal(new Win32PlatformOptions().RenderingMode, WindowSurfaces.Win32Options.RenderingMode);
|
||||
Assert.Contains(Win32RenderingMode.AngleEgl, WindowSurfaces.Win32Options.RenderingMode);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void The_options_go_to_the_same_builder()
|
||||
{
|
||||
var builder = AppBuilder.Configure<Avalonia.Application>();
|
||||
|
||||
Assert.Same(builder, WindowSurfaces.ApplyTo(builder));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user