mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-29 01:34:35 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ece440e566 | ||
|
|
3dfcbca711 | ||
|
|
9668b4d3b6 |
4
.github/workflows/dotnet.yml
vendored
4
.github/workflows/dotnet.yml
vendored
@@ -52,7 +52,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup .NET 10
|
||||
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
|
||||
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
|
||||
with:
|
||||
dotnet-version: 10.0.x
|
||||
|
||||
@@ -142,7 +142,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup .NET 10
|
||||
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
|
||||
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
|
||||
with:
|
||||
dotnet-version: 10.0.x
|
||||
|
||||
|
||||
2
.github/workflows/sonar.yml
vendored
2
.github/workflows/sonar.yml
vendored
@@ -62,7 +62,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup .NET 10
|
||||
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
|
||||
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
|
||||
with:
|
||||
dotnet-version: 10.0.x
|
||||
|
||||
|
||||
@@ -6,14 +6,27 @@ namespace StarterNG.Tests;
|
||||
public class WindowSurfacesTests
|
||||
{
|
||||
[Fact]
|
||||
public void Windows_draws_into_the_window_surface_and_never_through_winui_composition()
|
||||
public void Windows_draws_into_a_directcomposition_surface_and_never_through_winui_composition()
|
||||
{
|
||||
var options = WindowSurfaces.Win32Options;
|
||||
|
||||
Assert.Equal(new[] { Win32CompositionMode.RedirectionSurface }, options.CompositionMode);
|
||||
Assert.Equal(Win32CompositionMode.DirectComposition, options.CompositionMode.First());
|
||||
Assert.DoesNotContain(Win32CompositionMode.WinUIComposition, options.CompositionMode);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void The_window_surface_is_only_the_fallback()
|
||||
{
|
||||
// There ANGLE presents through a swap chain, and the Steam overlay draws over it.
|
||||
Assert.Equal(Win32CompositionMode.RedirectionSurface, WindowSurfaces.Win32Options.CompositionMode.Last());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void No_swap_chain_of_its_own_is_asked_for()
|
||||
{
|
||||
Assert.DoesNotContain(Win32CompositionMode.LowLatencyDxgiSwapChain, WindowSurfaces.Win32Options.CompositionMode);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void The_graphics_card_still_draws()
|
||||
{
|
||||
|
||||
@@ -3,17 +3,24 @@ 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
|
||||
/// On Windows the graphics card draws each window of the starter into a DirectComposition
|
||||
/// surface, 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.
|
||||
/// stayed black while the others drew, and came back only now and then.
|
||||
/// The window's own redirection surface is only the fallback: there ANGLE draws through a
|
||||
/// swap chain of the window, and the Steam overlay, which Steam puts into the starter as
|
||||
/// the game it launches, hooks that swap chain's Present and draws its frame counter and
|
||||
/// notifications over the starter. A composition surface is drawn without a Present.
|
||||
/// </summary>
|
||||
public static class WindowSurfaces
|
||||
{
|
||||
public static Win32PlatformOptions Win32Options => new()
|
||||
{
|
||||
CompositionMode = new[] { Win32CompositionMode.RedirectionSurface }
|
||||
CompositionMode = new[]
|
||||
{
|
||||
Win32CompositionMode.DirectComposition,
|
||||
Win32CompositionMode.RedirectionSurface
|
||||
}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user