From afdf0e988ccb286c416c653fa36f63f943f78ec7 Mon Sep 17 00:00:00 2001 From: lindexi Date: Fri, 27 Feb 2026 10:34:35 +0800 Subject: [PATCH 01/21] Try to pass the WindowTransparencyLevel to surface --- .../DirectCompositedWindowSurface.cs | 6 +++++ src/Windows/Avalonia.Win32/IBlurHost.cs | 5 ++++- .../Composition/WinUiCompositedWindow.cs | 6 +++++ .../WinUiCompositedWindowSurface.cs | 9 ++++++++ src/Windows/Avalonia.Win32/WindowImpl.cs | 22 ++++++++++++++----- 5 files changed, 42 insertions(+), 6 deletions(-) diff --git a/src/Windows/Avalonia.Win32/DComposition/DirectCompositedWindowSurface.cs b/src/Windows/Avalonia.Win32/DComposition/DirectCompositedWindowSurface.cs index d0651e08eec..e1b0a87aaa6 100644 --- a/src/Windows/Avalonia.Win32/DComposition/DirectCompositedWindowSurface.cs +++ b/src/Windows/Avalonia.Win32/DComposition/DirectCompositedWindowSurface.cs @@ -1,5 +1,6 @@ using System; using System.ComponentModel; +using Avalonia.Controls; using Avalonia.OpenGL.Egl; using Avalonia.Platform; using Avalonia.Win32.DirectX; @@ -43,6 +44,11 @@ public void SetBlur(BlurEffect enable) _blurEffect = enable; // _window?.SetBlur(enable); } + + public void SetTransparencyLevel(WindowTransparencyLevel transparencyLevel) + { + + } } internal class DirectCompositedWindowRenderTarget : IDirect3D11TextureRenderTarget diff --git a/src/Windows/Avalonia.Win32/IBlurHost.cs b/src/Windows/Avalonia.Win32/IBlurHost.cs index fcaf58eaacd..1b5dd9c9b44 100644 --- a/src/Windows/Avalonia.Win32/IBlurHost.cs +++ b/src/Windows/Avalonia.Win32/IBlurHost.cs @@ -1,4 +1,6 @@ -namespace Avalonia.Win32; +using Avalonia.Controls; + +namespace Avalonia.Win32; internal enum BlurEffect { @@ -14,4 +16,5 @@ internal interface ICompositionEffectsSurface bool IsBlurSupported(BlurEffect effect); void SetBlur(BlurEffect enable); + void SetTransparencyLevel(WindowTransparencyLevel transparencyLevel); } diff --git a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindow.cs b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindow.cs index d720e525d3a..cfc5435783a 100644 --- a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindow.cs +++ b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindow.cs @@ -1,6 +1,7 @@ using System; using System.Numerics; using System.Threading; +using Avalonia.Controls; using Avalonia.OpenGL.Egl; using Avalonia.Reactive; using MicroCom.Runtime; @@ -112,4 +113,9 @@ public void ResizeIfNeeded(PixelSize size) } } } + + public void SetTransparencyLevel(WindowTransparencyLevel transparencyLevel) + { + + } } diff --git a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs index 2addbc65248..0191ce6255d 100644 --- a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs +++ b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs @@ -1,4 +1,5 @@ using System; +using Avalonia.Controls; using Avalonia.OpenGL.Egl; using Avalonia.Platform; using Avalonia.Win32.DirectX; @@ -50,6 +51,14 @@ public void SetBlur(BlurEffect enable) _blurEffect = enable; _window?.SetBlur(enable); } + + public void SetTransparencyLevel(WindowTransparencyLevel transparencyLevel) + { + _windowTransparencyLevel = transparencyLevel; + _window?.SetTransparencyLevel(transparencyLevel); + } + + private WindowTransparencyLevel _windowTransparencyLevel; } internal class WinUiCompositedWindowRenderTarget : IDirect3D11TextureRenderTarget diff --git a/src/Windows/Avalonia.Win32/WindowImpl.cs b/src/Windows/Avalonia.Win32/WindowImpl.cs index c85b434761f..873e17413b7 100644 --- a/src/Windows/Avalonia.Win32/WindowImpl.cs +++ b/src/Windows/Avalonia.Win32/WindowImpl.cs @@ -4,6 +4,7 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Runtime.InteropServices; + using Avalonia.Collections.Pooled; using Avalonia.Controls; using Avalonia.Controls.Platform; @@ -11,21 +12,23 @@ using Avalonia.Input.Platform; using Avalonia.Input.Raw; using Avalonia.Input.TextInput; +using Avalonia.Logging; using Avalonia.OpenGL.Egl; using Avalonia.Platform; using Avalonia.Platform.Storage; +using Avalonia.Platform.Storage.FileIO; using Avalonia.Rendering.Composition; +using Avalonia.Threading; using Avalonia.Win32.DirectX; using Avalonia.Win32.Input; using Avalonia.Win32.Interop; using Avalonia.Win32.OpenGl; using Avalonia.Win32.OpenGl.Angle; using Avalonia.Win32.WinRT.Composition; -using static Avalonia.Win32.Interop.UnmanagedMethods; -using Avalonia.Platform.Storage.FileIO; -using Avalonia.Threading; + using static Avalonia.Controls.Win32Properties; -using Avalonia.Logging; +using static Avalonia.Rendering.Composition.Animations.PropertySetSnapshot; +using static Avalonia.Win32.Interop.UnmanagedMethods; namespace Avalonia.Win32 { @@ -177,7 +180,10 @@ public WindowImpl() _nativeControlHost = new Win32NativeControlHost(this, !UseRedirectionBitmap); _defaultTransparencyLevel = UseRedirectionBitmap ? WindowTransparencyLevel.None : WindowTransparencyLevel.Transparent; _transparencyLevel = _defaultTransparencyLevel; - s_instances.Add(this); + SetTransparencyLevel(_transparencyLevel); + + lock (s_instances) + s_instances.Add(this); } internal IInputRoot Owner @@ -318,6 +324,7 @@ private set if (_transparencyLevel != value) { _transparencyLevel = value; + SetTransparencyLevel(value); TransparencyLevelChanged?.Invoke(value); } } @@ -503,6 +510,11 @@ private unsafe bool SetUseHostBackdropBrush(bool useHostBackdropBrush) return result == 0; } + private void SetTransparencyLevel(WindowTransparencyLevel transparencyLevel) + { + CompositionEffectsSurface?.SetTransparencyLevel(transparencyLevel); + } + public IEnumerable Surfaces => _glSurface is null ? new object[] { Handle, _framebuffer } : From 64e63f2c91ae84fe651e6cea6a640564887cb578 Mon Sep 17 00:00:00 2001 From: lindexi Date: Fri, 27 Feb 2026 15:58:48 +0800 Subject: [PATCH 02/21] Enable change the AlphaMode in WinUI window. --- .../Composition/WinUiCompositedWindow.cs | 6 +++- .../WinUiCompositedWindowSurface.cs | 35 +++++++++++++++---- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindow.cs b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindow.cs index cfc5435783a..4bade8530a7 100644 --- a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindow.cs +++ b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindow.cs @@ -114,8 +114,12 @@ public void ResizeIfNeeded(PixelSize size) } } + public bool IsTransparency => _transparencyLevel != WindowTransparencyLevel.None; + public void SetTransparencyLevel(WindowTransparencyLevel transparencyLevel) { - + _transparencyLevel = transparencyLevel; } + + private WindowTransparencyLevel _transparencyLevel; } diff --git a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs index 0191ce6255d..b8143955992 100644 --- a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs +++ b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs @@ -27,6 +27,7 @@ public IDirect3D11TextureRenderTarget CreateRenderTarget(IPlatformGraphicsContex ?.WinUICompositionBackdropCornerRadius; _window ??= new WinUiCompositedWindow(_info, _shared, cornerRadius); _window.SetBlur(_blurEffect); + _window.SetTransparencyLevel(_windowTransparencyLevel); return new WinUiCompositedWindowRenderTarget(context, _window, d3dDevice, _shared.Compositor); } @@ -72,11 +73,11 @@ internal class WinUiCompositedWindowRenderTarget : IDirect3D11TextureRenderTarge private readonly ICompositorInterop _interop; private readonly ICompositionGraphicsDevice _compositionDevice; private readonly ICompositionGraphicsDevice2 _compositionDevice2; - private readonly ICompositionSurface _surface; + private ICompositionSurface _surface; private PixelSize _size; private bool _lost; - private readonly ICompositionDrawingSurfaceInterop _surfaceInterop; - private readonly ICompositionDrawingSurface _drawingSurface; + private ICompositionDrawingSurfaceInterop _surfaceInterop; + private ICompositionDrawingSurface _drawingSurface; public WinUiCompositedWindowRenderTarget(IPlatformGraphicsContext context, WinUiCompositedWindow window, IntPtr device, @@ -92,10 +93,8 @@ public WinUiCompositedWindowRenderTarget(IPlatformGraphicsContext context, _interop = compositor.QueryInterface(); _compositionDevice = _interop.CreateGraphicsDevice(_d3dDevice); _compositionDevice2 = _compositionDevice.QueryInterface(); - _drawingSurface = _compositionDevice2.CreateDrawingSurface2(new UnmanagedMethods.SIZE(), - DirectXPixelFormat.B8G8R8A8UIntNormalized, DirectXAlphaMode.Premultiplied); - _surface = _drawingSurface.QueryInterface(); - _surfaceInterop = _drawingSurface.QueryInterface(); + + CreateSurface(window); } catch { @@ -111,6 +110,16 @@ public WinUiCompositedWindowRenderTarget(IPlatformGraphicsContext context, } } + private void CreateSurface(WinUiCompositedWindow window) + { + // Do not use Premultiplied when the window is not Transparency. Because the Premultiplied AlphaMode will increase the performance loss of DWM. See https://github.com/AvaloniaUI/Avalonia/issues/20643 + var alphaMode = window.IsTransparency ? DirectXAlphaMode.Premultiplied : DirectXAlphaMode.Ignore; + _drawingSurface = _compositionDevice2.CreateDrawingSurface2(new UnmanagedMethods.SIZE(), + DirectXPixelFormat.B8G8R8A8UIntNormalized, alphaMode); + _surface = _drawingSurface.QueryInterface(); + _surfaceInterop = _drawingSurface.QueryInterface(); + } + public void Dispose() { _surface.Dispose(); @@ -130,6 +139,18 @@ public unsafe IDirect3D11TextureRenderTargetRenderSession BeginDraw() if (IsCorrupted) throw new RenderTargetCorruptedException(); var transaction = _window.BeginTransaction(); + + var supportTransparency = _drawingSurface.AlphaMode == DirectXAlphaMode.Premultiplied; + if (_window.IsTransparency != supportTransparency) + { + // Re-create the surface with correct alpha mode if the transparency support is not correct. This can happen when the transparency level is changed. + _surface.Dispose(); + _surfaceInterop.Dispose(); + _drawingSurface.Dispose(); + + CreateSurface(_window); + } + bool needsEndDraw = false; try { From 4a572dde6b01f5379bcdecb70d71240a3062b8b7 Mon Sep 17 00:00:00 2001 From: lindexi Date: Fri, 27 Feb 2026 16:29:42 +0800 Subject: [PATCH 03/21] Support disable transparency explicitly; --- src/Windows/Avalonia.Win32/WindowImpl.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Windows/Avalonia.Win32/WindowImpl.cs b/src/Windows/Avalonia.Win32/WindowImpl.cs index 873e17413b7..dbea9936fdb 100644 --- a/src/Windows/Avalonia.Win32/WindowImpl.cs +++ b/src/Windows/Avalonia.Win32/WindowImpl.cs @@ -376,6 +376,13 @@ private set public void SetTransparencyLevelHint(IReadOnlyList transparencyLevels) { + if (transparencyLevels.Count == 1 && transparencyLevels[0] == WindowTransparencyLevel.None) + { + // Explicitly disable transparency. Ignore the UseRedirectionBitmap property. + TransparencyLevel = WindowTransparencyLevel.None; + return; + } + foreach (var level in transparencyLevels) { if (!IsSupported(level)) From 14dfe19083cbc1949759965b3005822ec88d4e68 Mon Sep 17 00:00:00 2001 From: lindexi Date: Fri, 27 Feb 2026 16:47:10 +0800 Subject: [PATCH 04/21] Fix ICompositionDrawingSurfaceInterop.BeginDraw fail. Because the surface do not set size. --- .../WinRT/Composition/WinUiCompositedWindowSurface.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs index b8143955992..8fa4f8307b6 100644 --- a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs +++ b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs @@ -149,6 +149,13 @@ public unsafe IDirect3D11TextureRenderTargetRenderSession BeginDraw() _drawingSurface.Dispose(); CreateSurface(_window); + + var size = _window.WindowInfo.Size; + _surfaceInterop.Resize(new UnmanagedMethods.POINT + { + X = size.Width, + Y = size.Height + }); } bool needsEndDraw = false; From b48310141856fb9c94507bac12e5e8bf834b3fea Mon Sep 17 00:00:00 2001 From: lindexi Date: Fri, 27 Feb 2026 16:54:51 +0800 Subject: [PATCH 05/21] Merge the same code --- .../WinRT/Composition/WinUiCompositedWindowSurface.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs index 8fa4f8307b6..5f2ff4e6348 100644 --- a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs +++ b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs @@ -140,6 +140,7 @@ public unsafe IDirect3D11TextureRenderTargetRenderSession BeginDraw() throw new RenderTargetCorruptedException(); var transaction = _window.BeginTransaction(); + bool forceResize = false; var supportTransparency = _drawingSurface.AlphaMode == DirectXAlphaMode.Premultiplied; if (_window.IsTransparency != supportTransparency) { @@ -150,12 +151,8 @@ public unsafe IDirect3D11TextureRenderTargetRenderSession BeginDraw() CreateSurface(_window); - var size = _window.WindowInfo.Size; - _surfaceInterop.Resize(new UnmanagedMethods.POINT - { - X = size.Width, - Y = size.Height - }); + // The _drawingSurface.Size != _size, so that require force resize to update the size of surface. + forceResize = true; } bool needsEndDraw = false; @@ -170,7 +167,7 @@ public unsafe IDirect3D11TextureRenderTargetRenderSession BeginDraw() UnmanagedMethods.POINT off; try { - if (_size != size) + if (forceResize || _size != size) { _surfaceInterop.Resize(new UnmanagedMethods.POINT { From 539626340d971c46bc87ad1d9c98829474d9752b Mon Sep 17 00:00:00 2001 From: lindexi Date: Fri, 27 Feb 2026 16:57:34 +0800 Subject: [PATCH 06/21] Fix compile --- .../WinRT/Composition/WinUiCompositedWindowSurface.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs index 5f2ff4e6348..798a580bd54 100644 --- a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs +++ b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics.CodeAnalysis; using Avalonia.Controls; using Avalonia.OpenGL.Egl; using Avalonia.Platform; @@ -110,6 +111,7 @@ public WinUiCompositedWindowRenderTarget(IPlatformGraphicsContext context, } } + [MemberNotNull(nameof(_drawingSurface), nameof(_surface), nameof(_surfaceInterop))] private void CreateSurface(WinUiCompositedWindow window) { // Do not use Premultiplied when the window is not Transparency. Because the Premultiplied AlphaMode will increase the performance loss of DWM. See https://github.com/AvaloniaUI/Avalonia/issues/20643 From dbdbfd67c848050ca21004db308036b18e0dd109 Mon Sep 17 00:00:00 2001 From: lindexi Date: Thu, 5 Mar 2026 10:03:35 +0800 Subject: [PATCH 07/21] Put the re create surface to trycatch block. Solve the `transaction` do not be disposed when CreateSurface exception. --- .../WinUiCompositedWindowSurface.cs | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs index 798a580bd54..ee4c326fd67 100644 --- a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs +++ b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs @@ -142,24 +142,24 @@ public unsafe IDirect3D11TextureRenderTargetRenderSession BeginDraw() throw new RenderTargetCorruptedException(); var transaction = _window.BeginTransaction(); - bool forceResize = false; - var supportTransparency = _drawingSurface.AlphaMode == DirectXAlphaMode.Premultiplied; - if (_window.IsTransparency != supportTransparency) + bool needsEndDraw = false; + try { - // Re-create the surface with correct alpha mode if the transparency support is not correct. This can happen when the transparency level is changed. - _surface.Dispose(); - _surfaceInterop.Dispose(); - _drawingSurface.Dispose(); + bool forceResize = false; + var supportTransparency = _drawingSurface.AlphaMode == DirectXAlphaMode.Premultiplied; + if (_window.IsTransparency != supportTransparency) + { + // Re-create the surface with correct alpha mode if the transparency support is not correct. This can happen when the transparency level is changed. + _surface.Dispose(); + _surfaceInterop.Dispose(); + _drawingSurface.Dispose(); - CreateSurface(_window); + CreateSurface(_window); - // The _drawingSurface.Size != _size, so that require force resize to update the size of surface. - forceResize = true; - } + // The _drawingSurface.Size != _size, so that require force resize to update the size of surface. + forceResize = true; + } - bool needsEndDraw = false; - try - { var size = _window.WindowInfo.Size; var scale = _window.WindowInfo.Scaling; _window.ResizeIfNeeded(size); From 9e9a1bc47e6720b2364152c28e5f11bcc30d39ad Mon Sep 17 00:00:00 2001 From: lindexi Date: Thu, 5 Mar 2026 10:15:29 +0800 Subject: [PATCH 08/21] Add the dynamic Transparency alpha mode support to DirectComposited --- .../DComposition/DirectCompositedWindow.cs | 11 ++++- .../DirectCompositedWindowSurface.cs | 49 ++++++++++++++++--- 2 files changed, 51 insertions(+), 9 deletions(-) diff --git a/src/Windows/Avalonia.Win32/DComposition/DirectCompositedWindow.cs b/src/Windows/Avalonia.Win32/DComposition/DirectCompositedWindow.cs index 8935e8bcbff..de8caa85ccd 100644 --- a/src/Windows/Avalonia.Win32/DComposition/DirectCompositedWindow.cs +++ b/src/Windows/Avalonia.Win32/DComposition/DirectCompositedWindow.cs @@ -1,6 +1,6 @@ using System; -using System.Numerics; using System.Threading; +using Avalonia.Controls; using Avalonia.OpenGL.Egl; using Avalonia.Reactive; using MicroCom.Runtime; @@ -51,4 +51,13 @@ public IDisposable BeginTransaction() Monitor.Exit(_shared.SyncRoot); }); } + + public bool IsTransparency => _transparencyLevel != WindowTransparencyLevel.None; + + public void SetTransparencyLevel(WindowTransparencyLevel transparencyLevel) + { + _transparencyLevel = transparencyLevel; + } + + private WindowTransparencyLevel _transparencyLevel; } diff --git a/src/Windows/Avalonia.Win32/DComposition/DirectCompositedWindowSurface.cs b/src/Windows/Avalonia.Win32/DComposition/DirectCompositedWindowSurface.cs index e1b0a87aaa6..15e0f60c3ce 100644 --- a/src/Windows/Avalonia.Win32/DComposition/DirectCompositedWindowSurface.cs +++ b/src/Windows/Avalonia.Win32/DComposition/DirectCompositedWindowSurface.cs @@ -1,10 +1,15 @@ using System; using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; + using Avalonia.Controls; +using Avalonia.Controls.Shapes; using Avalonia.OpenGL.Egl; using Avalonia.Platform; using Avalonia.Win32.DirectX; using Avalonia.Win32.Interop; +using Avalonia.Win32.WinRT; + using MicroCom.Runtime; namespace Avalonia.Win32.DComposition; @@ -26,6 +31,7 @@ public IDirect3D11TextureRenderTarget CreateRenderTarget(IPlatformGraphicsContex { _window ??= new DirectCompositedWindow(_info, _shared); SetBlur(_blurEffect); + _window.SetTransparencyLevel(_windowTransparencyLevel); return new DirectCompositedWindowRenderTarget(context, d3dDevice, _shared, _window); } @@ -47,8 +53,11 @@ public void SetBlur(BlurEffect enable) public void SetTransparencyLevel(WindowTransparencyLevel transparencyLevel) { - + _windowTransparencyLevel = transparencyLevel; + _window?.SetTransparencyLevel(transparencyLevel); } + + private WindowTransparencyLevel _windowTransparencyLevel; } internal class DirectCompositedWindowRenderTarget : IDirect3D11TextureRenderTarget @@ -56,11 +65,13 @@ internal class DirectCompositedWindowRenderTarget : IDirect3D11TextureRenderTarg private static readonly Guid IID_ID3D11Texture2D = Guid.Parse("6f15aaf2-d208-4e89-9ab4-489535d34f9c"); private readonly IPlatformGraphicsContext _context; + private readonly DirectCompositionShared _shared; private readonly DirectCompositedWindow _window; - private readonly IDCompositionVirtualSurface _surface; + private IDCompositionVirtualSurface _surface; private bool _lost; private PixelSize _size; private readonly IUnknown _d3dDevice; + private bool _isSurfaceSupportTransparency; public DirectCompositedWindowRenderTarget( IPlatformGraphicsContext context, IntPtr d3dDevice, @@ -69,13 +80,25 @@ public DirectCompositedWindowRenderTarget( _d3dDevice = MicroComRuntime.CreateProxyFor(d3dDevice, false).CloneReference(); _context = context; + _shared = shared; _window = window; - using (var surfaceFactory = shared.Device.CreateSurfaceFactory(_d3dDevice)) - { - _surface = surfaceFactory.CreateVirtualSurface(1, 1, DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM, - DXGI_ALPHA_MODE.DXGI_ALPHA_MODE_PREMULTIPLIED); - } + CreateSurface(window); + } + + [MemberNotNull(nameof(_surface))] + private void CreateSurface(DirectCompositedWindow window) + { + using var surfaceFactory = _shared.Device.CreateSurfaceFactory(_d3dDevice); + + const uint initialSize = 1; + var alphaMode = window.IsTransparency ? + DXGI_ALPHA_MODE.DXGI_ALPHA_MODE_PREMULTIPLIED : + DXGI_ALPHA_MODE.DXGI_ALPHA_MODE_IGNORE; + _isSurfaceSupportTransparency = window.IsTransparency; + + _surface = surfaceFactory.CreateVirtualSurface(initialSize, initialSize, DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM, + alphaMode); } public void Dispose() @@ -94,9 +117,19 @@ public unsafe IDirect3D11TextureRenderTargetRenderSession BeginDraw() bool needsEndDraw = false; try { + bool forceResize = false; + if (_window.IsTransparency != _isSurfaceSupportTransparency) + { + _surface.Dispose(); + + CreateSurface(_window); + + forceResize = true; + } + var size = _window.WindowInfo.Size; var scale = _window.WindowInfo.Scaling; - if (_size != size) + if (forceResize || _size != size) { _surface.Resize((ushort)size.Width, (ushort)size.Height); _size = size; From a77759b599bb3ea51e56ceea31e6d72ed93bc68f Mon Sep 17 00:00:00 2001 From: lindexi Date: Wed, 21 Jan 2026 15:37:40 +0800 Subject: [PATCH 09/21] Fix the DxgiRenderTimerLoop thread get the screens from UI thread Fixes https://github.com/AvaloniaUI/Avalonia/issues/20508 --- .../Avalonia.Win32/DirectX/DxgiConnection.cs | 48 +++++++++++++++++-- src/Windows/Avalonia.Win32/ScreenImpl.cs | 5 ++ 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/src/Windows/Avalonia.Win32/DirectX/DxgiConnection.cs b/src/Windows/Avalonia.Win32/DirectX/DxgiConnection.cs index e7007c34481..902106b8dc4 100644 --- a/src/Windows/Avalonia.Win32/DirectX/DxgiConnection.cs +++ b/src/Windows/Avalonia.Win32/DirectX/DxgiConnection.cs @@ -1,13 +1,20 @@ using System; +using System.Collections.Generic; using System.Diagnostics; +using System.Runtime.InteropServices; using System.Threading.Tasks; using Avalonia.Logging; using Avalonia.OpenGL.Egl; using Avalonia.Rendering; -using static Avalonia.Win32.Interop.UnmanagedMethods; -using static Avalonia.Win32.DirectX.DirectXUnmanagedMethods; + using MicroCom.Runtime; +using Windows.Win32; +using Windows.Win32.Graphics.Gdi; + +using static Avalonia.Win32.DirectX.DirectXUnmanagedMethods; +using static Avalonia.Win32.Interop.UnmanagedMethods; + namespace Avalonia.Win32.DirectX { internal unsafe class DxgiConnection : IRenderTimer, IWindowsSurfaceFactory @@ -111,6 +118,8 @@ private void GetBestOutputToVWaitOn() ushort adapterIndex = 0; + Dictionary monitorFrequencies = GetAllMonitorFrequencies(); + // this looks odd, but that's just how one enumerates adapters in DXGI while (fact.EnumAdapters(adapterIndex, &adapterPointer) == 0) { @@ -122,8 +131,12 @@ private void GetBestOutputToVWaitOn() using var output = MicroComRuntime.CreateProxyFor(outputPointer, true); DXGI_OUTPUT_DESC outputDesc = output.Desc; - var screen = Win32Platform.Instance.Screen.ScreenFromHMonitor((IntPtr)outputDesc.Monitor.Value); - var frequency = screen?.Frequency ?? highestRefreshRate; + var hMonitor = new HMONITOR(outputDesc.Monitor.Value); + + var frequency = + monitorFrequencies.TryGetValue(hMonitor, out uint frequencyValue) ? + frequencyValue : + highestRefreshRate; if (highestRefreshRate < frequency) { @@ -145,6 +158,33 @@ private void GetBestOutputToVWaitOn() } + private unsafe Dictionary GetAllMonitorFrequencies() + { + var monitorHandlers = ScreenImpl.GetAllDisplayMonitorHandlers(); + var dictionary = new Dictionary(monitorHandlers.Count); + + foreach (var monitorHandler in monitorHandlers) + { + var info = MONITORINFOEX.Create(); + var hMonitor = new HMONITOR(monitorHandler); + PInvoke.GetMonitorInfo(hMonitor, (MONITORINFO*)&info); + + var deviceMode = new DEVMODEW + { + dmFields = DEVMODE_FIELD_FLAGS.DM_DISPLAYORIENTATION | DEVMODE_FIELD_FLAGS.DM_DISPLAYFREQUENCY, + dmSize = (ushort)Marshal.SizeOf() + }; + PInvoke.EnumDisplaySettings(info.szDevice.ToString(), ENUM_DISPLAY_SETTINGS_MODE.ENUM_CURRENT_SETTINGS, + ref deviceMode); + + var frequency = deviceMode.dmDisplayFrequency; + + dictionary[hMonitor] = frequency; + } + + return dictionary; + } + // Used the windows composition as a blueprint for this startup/creation private static bool TryCreateAndRegisterCore() { diff --git a/src/Windows/Avalonia.Win32/ScreenImpl.cs b/src/Windows/Avalonia.Win32/ScreenImpl.cs index 0f73d39249a..b4bff3da35d 100644 --- a/src/Windows/Avalonia.Win32/ScreenImpl.cs +++ b/src/Windows/Avalonia.Win32/ScreenImpl.cs @@ -15,6 +15,11 @@ internal unsafe class ScreenImpl : ScreensBase protected override int GetScreenCount() => GetSystemMetrics(SystemMetric.SM_CMONITORS); protected override IReadOnlyList GetAllScreenKeys() + { + return GetAllDisplayMonitorHandlers(); + } + + public static List GetAllDisplayMonitorHandlers() { var screens = new List(); var gcHandle = GCHandle.Alloc(screens); From 77a449a847b7243ffe39900946497802f84c3c28 Mon Sep 17 00:00:00 2001 From: lindexi Date: Thu, 22 Jan 2026 17:55:10 +0800 Subject: [PATCH 10/21] Reduce the number of WrapDirect3D11Texture calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reduce the number of WrapDirect3D11Texture calls by tying the EglSurface lifetime to _renderTexture. When testing on a 4K display, I observed that eglCreatePbufferFromClientBuffer, which is invoked by WrapDirect3D11Texture, can take around 5 ms per frame. By reducing the number of eglCreatePbufferFromClientBuffer calls, I was able to improve rendering performance by about 30%. However, I’m not sure why the previous implementation needed to call WrapDirect3D11Texture on every frame. --- .../DirectX/DxgiRenderTarget.cs | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs b/src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs index 513aba4f200..8a6e4837c0e 100644 --- a/src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs +++ b/src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs @@ -23,6 +23,7 @@ internal unsafe class DxgiRenderTarget : EglPlatformSurfaceRenderTargetBase private IUnknown? _renderTexture; private RECT _clientRect; + private EglSurface? _surface; public DxgiRenderTarget(EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo window, EglContext context, DxgiConnection connection) : base(context) { @@ -81,7 +82,6 @@ public override IGlPlatformSurfaceRenderingSession BeginDrawCore() } var contextLock = Context.EnsureCurrent(); - EglSurface? surface = null; IDisposable? transaction = null; var success = false; try @@ -94,6 +94,9 @@ public override IGlPlatformSurfaceRenderingSession BeginDrawCore() if (_renderTexture is not null) { + _surface?.Dispose(); + _surface = null; + _renderTexture.Dispose(); _renderTexture = null; } @@ -112,19 +115,26 @@ public override IGlPlatformSurfaceRenderingSession BeginDrawCore() var texture = _renderTexture; if (texture is null) { + _surface?.Dispose(); + _surface = null; + Guid textureGuid = ID3D11Texture2DGuid; texture = MicroComRuntime.CreateProxyFor(_swapChain.GetBuffer(0, &textureGuid), true); } _renderTexture = texture; - // I also have to get the pointer to this texture directly - surface = ((AngleWin32EglDisplay)Context.Display).WrapDirect3D11Texture(MicroComRuntime.GetNativeIntPtr(_renderTexture), - 0, 0, size.Width, size.Height); + if (_surface is null) + { + // I also have to get the pointer to this texture directly + _surface = ((AngleWin32EglDisplay)Context.Display).WrapDirect3D11Texture(MicroComRuntime.GetNativeIntPtr(_renderTexture), + 0, 0, size.Width, size.Height); + } - var res = base.BeginDraw(surface, _window.Size, _window.Scaling, () => + var res = base.BeginDraw(_surface, _window.Size, _window.Scaling, () => { _swapChain.Present((ushort)0U, (ushort)0U); - surface.Dispose(); + // No need to Dispose here. The _surface only Dispose when _renderTexture Disposed. + //_surface.Dispose(); transaction?.Dispose(); contextLock?.Dispose(); }, true); @@ -135,7 +145,8 @@ public override IGlPlatformSurfaceRenderingSession BeginDrawCore() { if (!success) { - surface?.Dispose(); + _surface?.Dispose(); + _surface = null; if (_renderTexture is not null) { _renderTexture.Dispose(); @@ -153,6 +164,7 @@ public override void Dispose() _dxgiDevice?.Dispose(); _dxgiFactory?.Dispose(); _swapChain?.Dispose(); + _surface?.Dispose(); _renderTexture?.Dispose(); } From 15bc2503043a3b234eca68bd18e80456988aa0d2 Mon Sep 17 00:00:00 2001 From: lindexi Date: Thu, 12 Mar 2026 20:02:28 +0800 Subject: [PATCH 11/21] Let the dxgi support WindowTransparencyLevel. Part 1 --- .../Avalonia.Win32/DirectX/DxgiConnection.cs | 14 ++- .../DirectX/DxgiRenderTarget.cs | 110 +++++++++++------- .../DirectX/DxgiSwapchainWindow.cs | 32 ++++- 3 files changed, 112 insertions(+), 44 deletions(-) diff --git a/src/Windows/Avalonia.Win32/DirectX/DxgiConnection.cs b/src/Windows/Avalonia.Win32/DirectX/DxgiConnection.cs index 902106b8dc4..478bc7b1ed7 100644 --- a/src/Windows/Avalonia.Win32/DirectX/DxgiConnection.cs +++ b/src/Windows/Avalonia.Win32/DirectX/DxgiConnection.cs @@ -208,12 +208,22 @@ private static bool TryCreateAndRegisterCore() }); thread.IsBackground = true; thread.SetApartmentState(System.Threading.ApartmentState.STA); + thread.Name = "DxgiRenderTimerLoop"; thread.Start(); // block until return tcs.Task.Result; } - public bool RequiresNoRedirectionBitmap => false; - public object CreateSurface(EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo info) => new DxgiSwapchainWindow(this, info); + public bool RequiresNoRedirectionBitmap => IsTransparencySupported() + ? true + : false; + + public IPlatformRenderSurface CreateSurface(EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo info) => new DxgiSwapchainWindow(this, info); + + public static bool IsTransparencySupported() + { + // We can use the DirectComposited+CreateSwapChainForComposition to create the Transparency window. + return Win32Platform.WindowsVersion >= PlatformConstants.Windows8_1; + } } } diff --git a/src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs b/src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs index 8a6e4837c0e..01ff6a2a4f5 100644 --- a/src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs +++ b/src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs @@ -1,4 +1,6 @@ using System; +using System.Diagnostics.CodeAnalysis; +using Avalonia.Controls; using Avalonia.OpenGL.Egl; using Avalonia.OpenGL.Surfaces; using Avalonia.Win32.OpenGl.Angle; @@ -17,18 +19,21 @@ internal unsafe class DxgiRenderTarget : EglPlatformSurfaceRenderTargetBase private readonly EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo _window; private readonly DxgiConnection _connection; private readonly IDXGIDevice? _dxgiDevice; - private readonly IDXGIFactory2? _dxgiFactory; - private readonly IDXGISwapChain1? _swapChain; - private readonly uint _flagsUsed; + private readonly IDXGIFactory2 _dxgiFactory; + private IDXGISwapChain1? _swapChain; + private DXGI_SWAP_CHAIN_FLAG _dxgiSwapChainDescFlagsUsed; + private const uint SwapChainDescBufferCount = 2; private IUnknown? _renderTexture; - private RECT _clientRect; + private PixelSize _size; private EglSurface? _surface; - public DxgiRenderTarget(EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo window, EglContext context, DxgiConnection connection) : base(context) + public DxgiRenderTarget(EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo window, EglContext context, + DxgiConnection connection, WindowTransparencyLevel transparencyLevel) : base(context) { _window = window; _connection = connection; + _transparencyLevel = transparencyLevel; // the D3D device is expected to at least be an ID3D11Device // but how do I wrap an IntPtr as a managed IUnknown now? Like this. @@ -43,34 +48,53 @@ public DxgiRenderTarget(EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo win _dxgiFactory = MicroComRuntime.CreateProxyFor(adapterPointer.GetParent(&factoryGuid), true); } - DXGI_SWAP_CHAIN_DESC1 dxgiSwapChainDesc = new DXGI_SWAP_CHAIN_DESC1(); - - // standard swap chain really. - dxgiSwapChainDesc.Format = DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM; - dxgiSwapChainDesc.SampleDesc.Count = 1U; - dxgiSwapChainDesc.SampleDesc.Quality = 0U; - dxgiSwapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; - dxgiSwapChainDesc.AlphaMode = DXGI_ALPHA_MODE.DXGI_ALPHA_MODE_IGNORE; - dxgiSwapChainDesc.Width = (uint)_window.Size.Width; - dxgiSwapChainDesc.Height = (uint)_window.Size.Height; - dxgiSwapChainDesc.BufferCount = 2U; - dxgiSwapChainDesc.SwapEffect = DXGI_SWAP_EFFECT.DXGI_SWAP_EFFECT_FLIP_DISCARD; - - // okay I know this looks bad, but we're hitting our render-calls by awaiting via dxgi - // this is done in the DxgiConnection itself - _flagsUsed = dxgiSwapChainDesc.Flags = (uint)(DXGI_SWAP_CHAIN_FLAG.DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING); - - _swapChain = _dxgiFactory.CreateSwapChainForHwnd - ( + CreateSurface(window.Size); + + _dxgiFactory.MakeWindowAssociation(window.Handle, (uint)(DXGI_MWA.DXGI_MWA_NO_ALT_ENTER | DXGI_MWA.DXGI_MWA_NO_PRINT_SCREEN)); + } + + [MemberNotNull(nameof(_swapChain))] + private void CreateSurface(PixelSize expectedPixelSize) + { + _swapChain?.Dispose(); + _swapChain = null; + + var windowInfo = _window; + var size = expectedPixelSize; + + //if (IsTransparency && DxgiConnection.IsTransparencySupported()) + //{ + + //} + //else + { + DXGI_SWAP_CHAIN_DESC1 dxgiSwapChainDesc = new DXGI_SWAP_CHAIN_DESC1(); + + // standard swap chain really. + dxgiSwapChainDesc.Format = DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM; + dxgiSwapChainDesc.SampleDesc.Count = 1U; + dxgiSwapChainDesc.SampleDesc.Quality = 0U; + dxgiSwapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; + dxgiSwapChainDesc.AlphaMode = DXGI_ALPHA_MODE.DXGI_ALPHA_MODE_IGNORE; + dxgiSwapChainDesc.Width = (uint) size.Width; + dxgiSwapChainDesc.Height = (uint)size.Height; + dxgiSwapChainDesc.BufferCount = SwapChainDescBufferCount; + dxgiSwapChainDesc.SwapEffect = DXGI_SWAP_EFFECT.DXGI_SWAP_EFFECT_FLIP_DISCARD; + + _dxgiSwapChainDescFlagsUsed = DXGI_SWAP_CHAIN_FLAG.DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING; + dxgiSwapChainDesc.Flags = (uint)_dxgiSwapChainDescFlagsUsed; + + _swapChain = _dxgiFactory.CreateSwapChainForHwnd + ( _dxgiDevice, - window.Handle, + windowInfo.Handle, &dxgiSwapChainDesc, null, null - ); + ); + } - GetClientRect(_window.Handle, out var pClientRect); - _clientRect = pClientRect; + _size = size; } /// @@ -86,12 +110,12 @@ public override IGlPlatformSurfaceRenderingSession BeginDrawCore() var success = false; try { - GetClientRect(_window.Handle, out var pClientRect); - if (!RectsEqual(pClientRect, _clientRect)) - { - // we gotta resize - _clientRect = pClientRect; + var size = sceneInfo.Size; + var scale = sceneInfo.Scaling; + if (_size != size) + { + // we gotta resize if (_renderTexture is not null) { _surface?.Dispose(); @@ -101,16 +125,14 @@ public override IGlPlatformSurfaceRenderingSession BeginDrawCore() _renderTexture = null; } - _swapChain.ResizeBuffers(2, - (ushort)(pClientRect.right - pClientRect.left), - (ushort)(pClientRect.bottom - pClientRect.top), + _swapChain.ResizeBuffers(SwapChainDescBufferCount, + (ushort)size.Width, (ushort)size.Height, DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM, - (ushort)_flagsUsed + (uint)_dxgiSwapChainDescFlagsUsed ); + _size = size; } - var size = _window.Size; - // Get swapchain texture here var texture = _renderTexture; if (texture is null) @@ -130,7 +152,7 @@ public override IGlPlatformSurfaceRenderingSession BeginDrawCore() 0, 0, size.Width, size.Height); } - var res = base.BeginDraw(_surface, _window.Size, _window.Scaling, () => + var res = base.BeginDraw(_surface, size, scale, () => { _swapChain.Present((ushort)0U, (ushort)0U); // No need to Dispose here. The _surface only Dispose when _renderTexture Disposed. @@ -176,5 +198,13 @@ internal static bool RectsEqual(in RECT l, in RECT r) && (l.bottom == r.bottom); } + public bool IsTransparency => _transparencyLevel != WindowTransparencyLevel.None; + + public void SetTransparencyLevel(WindowTransparencyLevel transparencyLevel) + { + _transparencyLevel = transparencyLevel; + } + + private WindowTransparencyLevel _transparencyLevel; } } diff --git a/src/Windows/Avalonia.Win32/DirectX/DxgiSwapchainWindow.cs b/src/Windows/Avalonia.Win32/DirectX/DxgiSwapchainWindow.cs index a4c6598473a..b57f3e6214e 100644 --- a/src/Windows/Avalonia.Win32/DirectX/DxgiSwapchainWindow.cs +++ b/src/Windows/Avalonia.Win32/DirectX/DxgiSwapchainWindow.cs @@ -3,16 +3,18 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using Avalonia.Controls; using Avalonia.OpenGL; using Avalonia.OpenGL.Egl; using Avalonia.OpenGL.Surfaces; namespace Avalonia.Win32.DirectX { - internal class DxgiSwapchainWindow : EglGlPlatformSurfaceBase + internal class DxgiSwapchainWindow : EglGlPlatformSurfaceBase, ICompositionEffectsSurface, IDisposable { private DxgiConnection _connection; private EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo _window; + private DxgiRenderTarget? _renderTarget; public DxgiSwapchainWindow(DxgiConnection connection, EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo window) { @@ -22,11 +24,37 @@ public DxgiSwapchainWindow(DxgiConnection connection, EglGlPlatformSurface.IEglW public override IGlPlatformSurfaceRenderTarget CreateGlRenderTarget(IGlContext context) { + _renderTarget?.Dispose(); + var eglContext = (EglContext)context; using (eglContext.EnsureCurrent()) { - return new DxgiRenderTarget(_window, eglContext, _connection); + _renderTarget = new DxgiRenderTarget(_window, eglContext, _connection, _windowTransparencyLevel); } + + return _renderTarget; + } + + public bool IsBlurSupported(BlurEffect effect) + => effect == BlurEffect.None; + + public void SetBlur(BlurEffect enable) + { + // do nothing + } + + public void SetTransparencyLevel(WindowTransparencyLevel transparencyLevel) + { + _windowTransparencyLevel = transparencyLevel; + _renderTarget?.SetTransparencyLevel(transparencyLevel); + } + + private WindowTransparencyLevel _windowTransparencyLevel; + + public void Dispose() + { + _renderTarget?.Dispose(); + _renderTarget = null; } } } From 677f471df79d277474c4cd62727126d3b550b2ef Mon Sep 17 00:00:00 2001 From: lindexi Date: Thu, 12 Mar 2026 20:57:13 +0800 Subject: [PATCH 12/21] Finish switch Transparency mode in dxgi --- .../DirectX/DxgiRenderTarget.cs | 91 +++++++++++++++---- 1 file changed, 72 insertions(+), 19 deletions(-) diff --git a/src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs b/src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs index 01ff6a2a4f5..a513e436528 100644 --- a/src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs +++ b/src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs @@ -1,10 +1,17 @@ using System; +using System.ComponentModel; using System.Diagnostics.CodeAnalysis; + using Avalonia.Controls; using Avalonia.OpenGL.Egl; using Avalonia.OpenGL.Surfaces; +using Avalonia.Platform; +using Avalonia.Win32.DComposition; +using Avalonia.Win32.Interop; using Avalonia.Win32.OpenGl.Angle; + using MicroCom.Runtime; + using static Avalonia.Win32.Interop.UnmanagedMethods; namespace Avalonia.Win32.DirectX @@ -53,37 +60,72 @@ public DxgiRenderTarget(EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo win _dxgiFactory.MakeWindowAssociation(window.Handle, (uint)(DXGI_MWA.DXGI_MWA_NO_ALT_ENTER | DXGI_MWA.DXGI_MWA_NO_PRINT_SCREEN)); } + private IDCompositionDesktopDevice? _compositionDesktopDevice; + private IDCompositionTarget? _compositionTarget; + [MemberNotNull(nameof(_swapChain))] private void CreateSurface(PixelSize expectedPixelSize) { _swapChain?.Dispose(); _swapChain = null; + _compositionDesktopDevice?.Dispose(); + _compositionDesktopDevice = null; + + _compositionTarget?.Dispose(); + _compositionTarget = null; + + _surface?.Dispose(); + _surface = null; + + _renderTexture?.Dispose(); + _renderTexture = null; + var windowInfo = _window; var size = expectedPixelSize; - //if (IsTransparency && DxgiConnection.IsTransparencySupported()) - //{ + DXGI_SWAP_CHAIN_DESC1 dxgiSwapChainDesc = new DXGI_SWAP_CHAIN_DESC1(); + + // standard swap chain really. + dxgiSwapChainDesc.Format = DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM; + dxgiSwapChainDesc.SampleDesc.Count = 1U; + dxgiSwapChainDesc.SampleDesc.Quality = 0U; + dxgiSwapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; + dxgiSwapChainDesc.AlphaMode = DXGI_ALPHA_MODE.DXGI_ALPHA_MODE_IGNORE; + dxgiSwapChainDesc.Width = (uint)size.Width; + dxgiSwapChainDesc.Height = (uint)size.Height; + dxgiSwapChainDesc.BufferCount = SwapChainDescBufferCount; + dxgiSwapChainDesc.SwapEffect = DXGI_SWAP_EFFECT.DXGI_SWAP_EFFECT_FLIP_DISCARD; + + _dxgiSwapChainDescFlagsUsed = DXGI_SWAP_CHAIN_FLAG.DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING; + dxgiSwapChainDesc.Flags = (uint)_dxgiSwapChainDescFlagsUsed; - //} - //else + if (IsTransparency && DxgiConnection.IsTransparencySupported()) { - DXGI_SWAP_CHAIN_DESC1 dxgiSwapChainDesc = new DXGI_SWAP_CHAIN_DESC1(); - - // standard swap chain really. - dxgiSwapChainDesc.Format = DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM; - dxgiSwapChainDesc.SampleDesc.Count = 1U; - dxgiSwapChainDesc.SampleDesc.Quality = 0U; - dxgiSwapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; - dxgiSwapChainDesc.AlphaMode = DXGI_ALPHA_MODE.DXGI_ALPHA_MODE_IGNORE; - dxgiSwapChainDesc.Width = (uint) size.Width; - dxgiSwapChainDesc.Height = (uint)size.Height; - dxgiSwapChainDesc.BufferCount = SwapChainDescBufferCount; - dxgiSwapChainDesc.SwapEffect = DXGI_SWAP_EFFECT.DXGI_SWAP_EFFECT_FLIP_DISCARD; - - _dxgiSwapChainDescFlagsUsed = DXGI_SWAP_CHAIN_FLAG.DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING; - dxgiSwapChainDesc.Flags = (uint)_dxgiSwapChainDescFlagsUsed; + dxgiSwapChainDesc.AlphaMode = DXGI_ALPHA_MODE.DXGI_ALPHA_MODE_PREMULTIPLIED; + _swapChain = _dxgiFactory.CreateSwapChainForComposition(_dxgiDevice, &dxgiSwapChainDesc, null); + + Guid IID_IDCompositionDesktopDevice = Guid.Parse("5f4633fe-1e08-4cb8-8c75-ce24333f5602"); + var result = NativeMethods.DCompositionCreateDevice2(default, IID_IDCompositionDesktopDevice, out var cDevice); + if (result != UnmanagedMethods.HRESULT.S_OK) + { + throw new Win32Exception((int)result); + } + + var device = MicroComRuntime.CreateProxyFor(cDevice, ownsHandle: true); + _compositionDesktopDevice = device; + using IDCompositionVisual compositionVisual = + device.CreateTargetForHwnd(windowInfo.Handle, topmost: true); + var compositionTarget = compositionVisual.QueryInterface(); + _compositionTarget = compositionTarget; + IDCompositionVisual container = device.CreateVisual(); + container.SetContent(_swapChain); + compositionTarget.SetRoot(container); + device.Commit(); + } + else + { _swapChain = _dxgiFactory.CreateSwapChainForHwnd ( _dxgiDevice, @@ -113,6 +155,14 @@ public override IGlPlatformSurfaceRenderingSession BeginDrawCore() var size = sceneInfo.Size; var scale = sceneInfo.Scaling; + var shouldTransparency = IsTransparency && DxgiConnection.IsTransparencySupported(); + var isSupportTransparency = _swapChain.Desc1.AlphaMode is DXGI_ALPHA_MODE.DXGI_ALPHA_MODE_PREMULTIPLIED or DXGI_ALPHA_MODE.DXGI_ALPHA_MODE_STRAIGHT; + + if (shouldTransparency != isSupportTransparency) + { + CreateSurface(size); + } + if (_size != size) { // we gotta resize @@ -188,6 +238,9 @@ public override void Dispose() _swapChain?.Dispose(); _surface?.Dispose(); _renderTexture?.Dispose(); + + _compositionDesktopDevice?.Dispose(); + _compositionTarget?.Dispose(); } internal static bool RectsEqual(in RECT l, in RECT r) From 12f0c9f357f970a2a25cc9c94a6df26410926234 Mon Sep 17 00:00:00 2001 From: lindexi Date: Mon, 16 Mar 2026 14:48:20 +0800 Subject: [PATCH 13/21] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E8=B0=83=E8=AF=95=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WinRT/Composition/WinUiCompositedWindowSurface.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs index ee4c326fd67..270fd626735 100644 --- a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs +++ b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs @@ -114,12 +114,16 @@ public WinUiCompositedWindowRenderTarget(IPlatformGraphicsContext context, [MemberNotNull(nameof(_drawingSurface), nameof(_surface), nameof(_surfaceInterop))] private void CreateSurface(WinUiCompositedWindow window) { + Console.WriteLine("============================="); // Do not use Premultiplied when the window is not Transparency. Because the Premultiplied AlphaMode will increase the performance loss of DWM. See https://github.com/AvaloniaUI/Avalonia/issues/20643 var alphaMode = window.IsTransparency ? DirectXAlphaMode.Premultiplied : DirectXAlphaMode.Ignore; _drawingSurface = _compositionDevice2.CreateDrawingSurface2(new UnmanagedMethods.SIZE(), DirectXPixelFormat.B8G8R8A8UIntNormalized, alphaMode); _surface = _drawingSurface.QueryInterface(); _surfaceInterop = _drawingSurface.QueryInterface(); + + Console.WriteLine($"CreateSurface alphaMode={alphaMode}"); + } public void Dispose() From f41b6224cfb44ae59ce11e49a7bc3e180c7685e0 Mon Sep 17 00:00:00 2001 From: lindexi Date: Mon, 16 Mar 2026 14:48:29 +0800 Subject: [PATCH 14/21] =?UTF-8?q?Revert=20"=E5=B0=9D=E8=AF=95=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E8=BE=93=E5=87=BA=E8=B0=83=E8=AF=95=E4=BF=A1=E6=81=AF?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 12f0c9f357f970a2a25cc9c94a6df26410926234. --- .../WinRT/Composition/WinUiCompositedWindowSurface.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs index 270fd626735..ee4c326fd67 100644 --- a/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs +++ b/src/Windows/Avalonia.Win32/WinRT/Composition/WinUiCompositedWindowSurface.cs @@ -114,16 +114,12 @@ public WinUiCompositedWindowRenderTarget(IPlatformGraphicsContext context, [MemberNotNull(nameof(_drawingSurface), nameof(_surface), nameof(_surfaceInterop))] private void CreateSurface(WinUiCompositedWindow window) { - Console.WriteLine("============================="); // Do not use Premultiplied when the window is not Transparency. Because the Premultiplied AlphaMode will increase the performance loss of DWM. See https://github.com/AvaloniaUI/Avalonia/issues/20643 var alphaMode = window.IsTransparency ? DirectXAlphaMode.Premultiplied : DirectXAlphaMode.Ignore; _drawingSurface = _compositionDevice2.CreateDrawingSurface2(new UnmanagedMethods.SIZE(), DirectXPixelFormat.B8G8R8A8UIntNormalized, alphaMode); _surface = _drawingSurface.QueryInterface(); _surfaceInterop = _drawingSurface.QueryInterface(); - - Console.WriteLine($"CreateSurface alphaMode={alphaMode}"); - } public void Dispose() From 2b8838a2f3d469f1887818d749eb98a607819433 Mon Sep 17 00:00:00 2001 From: M0N7Y5 <17201053+M0n7y5@users.noreply.github.com> Date: Mon, 16 Jun 2025 11:38:14 +0200 Subject: [PATCH 15/21] fix: Prevent DXGI from intercepting Alt+Enter and PrintScreen (#18970) * disable key shortcuts forced by dxgi composition * moved enum, fixed types --- src/Windows/Avalonia.Win32/DirectX/DirectXEnums.cs | 8 ++++++++ src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Windows/Avalonia.Win32/DirectX/DirectXEnums.cs b/src/Windows/Avalonia.Win32/DirectX/DirectXEnums.cs index 1357e8aa633..ac6f0678d72 100644 --- a/src/Windows/Avalonia.Win32/DirectX/DirectXEnums.cs +++ b/src/Windows/Avalonia.Win32/DirectX/DirectXEnums.cs @@ -213,6 +213,14 @@ internal enum DXGI_ERROR : uint DXGI_ERROR_WAS_STILL_DRAWING = 0x887A000A } + [Flags] + internal enum DXGI_MWA : uint + { + DXGI_MWA_NO_WINDOW_CHANGES = 1, + DXGI_MWA_NO_ALT_ENTER = 2, + DXGI_MWA_NO_PRINT_SCREEN = 4 + } + internal static class DxgiErrorExtensions { public static bool IsDeviceLostError(this DXGI_ERROR error) diff --git a/src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs b/src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs index a513e436528..46d03b98027 100644 --- a/src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs +++ b/src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs @@ -136,7 +136,10 @@ private void CreateSurface(PixelSize expectedPixelSize) ); } - _size = size; + _dxgiFactory.MakeWindowAssociation(window.Handle, (uint)(DXGI_MWA.DXGI_MWA_NO_ALT_ENTER | DXGI_MWA.DXGI_MWA_NO_PRINT_SCREEN)); + + GetClientRect(_window.Handle, out var pClientRect); + _clientRect = pClientRect; } /// From 754fdc77a2f5f3e3d1474eb5e313f1db8b35379d Mon Sep 17 00:00:00 2001 From: lindexi Date: Mon, 16 Mar 2026 14:57:08 +0800 Subject: [PATCH 16/21] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Windows/Avalonia.Win32/DirectX/DxgiConnection.cs | 4 ++-- src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Windows/Avalonia.Win32/DirectX/DxgiConnection.cs b/src/Windows/Avalonia.Win32/DirectX/DxgiConnection.cs index 478bc7b1ed7..fc18c9d1c89 100644 --- a/src/Windows/Avalonia.Win32/DirectX/DxgiConnection.cs +++ b/src/Windows/Avalonia.Win32/DirectX/DxgiConnection.cs @@ -131,7 +131,7 @@ private void GetBestOutputToVWaitOn() using var output = MicroComRuntime.CreateProxyFor(outputPointer, true); DXGI_OUTPUT_DESC outputDesc = output.Desc; - var hMonitor = new HMONITOR(outputDesc.Monitor.Value); + var hMonitor = new HMONITOR((nint) outputDesc.Monitor.Value); var frequency = monitorFrequencies.TryGetValue(hMonitor, out uint frequencyValue) ? @@ -218,7 +218,7 @@ private static bool TryCreateAndRegisterCore() ? true : false; - public IPlatformRenderSurface CreateSurface(EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo info) => new DxgiSwapchainWindow(this, info); + public object CreateSurface(EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo info) => new DxgiSwapchainWindow(this, info); public static bool IsTransparencySupported() { diff --git a/src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs b/src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs index 46d03b98027..b0151aae1e5 100644 --- a/src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs +++ b/src/Windows/Avalonia.Win32/DirectX/DxgiRenderTarget.cs @@ -136,10 +136,7 @@ private void CreateSurface(PixelSize expectedPixelSize) ); } - _dxgiFactory.MakeWindowAssociation(window.Handle, (uint)(DXGI_MWA.DXGI_MWA_NO_ALT_ENTER | DXGI_MWA.DXGI_MWA_NO_PRINT_SCREEN)); - - GetClientRect(_window.Handle, out var pClientRect); - _clientRect = pClientRect; + _dxgiFactory.MakeWindowAssociation(windowInfo.Handle, (uint)(DXGI_MWA.DXGI_MWA_NO_ALT_ENTER | DXGI_MWA.DXGI_MWA_NO_PRINT_SCREEN)); } /// @@ -155,8 +152,8 @@ public override IGlPlatformSurfaceRenderingSession BeginDrawCore() var success = false; try { - var size = sceneInfo.Size; - var scale = sceneInfo.Scaling; + var size = _window.Size; + var scale = _window.Scaling; var shouldTransparency = IsTransparency && DxgiConnection.IsTransparencySupported(); var isSupportTransparency = _swapChain.Desc1.AlphaMode is DXGI_ALPHA_MODE.DXGI_ALPHA_MODE_PREMULTIPLIED or DXGI_ALPHA_MODE.DXGI_ALPHA_MODE_STRAIGHT; From adb85ec39cc1ed8f305447ef383926e95e9b7d29 Mon Sep 17 00:00:00 2001 From: lindexi Date: Mon, 16 Mar 2026 15:09:55 +0800 Subject: [PATCH 17/21] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Directory.Build.props | 2 ++ global.json | 2 +- nukebuild/Build.cs | 16 ++++++++-------- .../Avalonia.Browser/Avalonia.Browser.csproj | 3 ++- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 117c0964d20..6cb7a683303 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -9,5 +9,7 @@ false False 12 + + false diff --git a/global.json b/global.json index 28c43eff46d..2ff28310526 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.404", + "rollForward": "latestFeature" }, "msbuild-sdks": { diff --git a/nukebuild/Build.cs b/nukebuild/Build.cs index c6942e430c3..1d781e047b7 100644 --- a/nukebuild/Build.cs +++ b/nukebuild/Build.cs @@ -124,14 +124,14 @@ DotNetTestSettings ApplySetting(DotNetTestSettings c, Configure !Parameters.SkipPreviewer) .Executes(() => { - var webappDir = RootDirectory / "src" / "Avalonia.DesignerSupport" / "Remote" / "HtmlTransport" / "webapp"; - - NpmTasks.NpmInstall(c => c - .SetProcessWorkingDirectory(webappDir) - .SetProcessArgumentConfigurator(a => a.Add("--silent"))); - NpmTasks.NpmRun(c => c - .SetProcessWorkingDirectory(webappDir) - .SetCommand("dist")); + //var webappDir = RootDirectory / "src" / "Avalonia.DesignerSupport" / "Remote" / "HtmlTransport" / "webapp"; + + //NpmTasks.NpmInstall(c => c + // .SetProcessWorkingDirectory(webappDir) + // .SetProcessArgumentConfigurator(a => a.Add("--silent"))); + //NpmTasks.NpmRun(c => c + // .SetProcessWorkingDirectory(webappDir) + // .SetCommand("dist")); }); Target CompileNative => _ => _ diff --git a/src/Browser/Avalonia.Browser/Avalonia.Browser.csproj b/src/Browser/Avalonia.Browser/Avalonia.Browser.csproj index 314632e0db5..77e96cb8945 100644 --- a/src/Browser/Avalonia.Browser/Avalonia.Browser.csproj +++ b/src/Browser/Avalonia.Browser/Avalonia.Browser.csproj @@ -1,8 +1,9 @@ - + $(AvsCurrentTargetFramework);$(AvsCurrentBrowserTargetFramework) enable true + true From e324fd5477a58b85b90d3206da02e1fde765e908 Mon Sep 17 00:00:00 2001 From: lindexi Date: Mon, 16 Mar 2026 16:45:10 +0800 Subject: [PATCH 18/21] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=87=8F=E5=B0=91?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=BF=AE=E5=A4=8D=E6=9E=84=E5=BB=BA=E4=BD=86?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Avalonia.sln | 38 +------------------ build/DevSingleProject.targets | 10 ++--- .../ControlCatalog.Android.csproj | 1 - .../ControlCatalog.Browser.Blazor.csproj | 1 - .../ControlCatalog.Browser.csproj | 3 +- .../ControlCatalog.iOS.csproj | 1 - .../SafeAreaDemo.Android.csproj | 1 - .../SafeAreaDemo.iOS/SafeAreaDemo.iOS.csproj | 1 - 8 files changed, 8 insertions(+), 48 deletions(-) diff --git a/Avalonia.sln b/Avalonia.sln index a0314b1c330..d6743493d28 100644 --- a/Avalonia.sln +++ b/Avalonia.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31903.59 +# Visual Studio Version 18 +VisualStudioVersion = 18.3.11520.95 d18.3 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Base", "src\Avalonia.Base\Avalonia.Base.csproj", "{B09B78D8-9B26-48B0-9149-D64A2F120F3F}" EndProject @@ -54,14 +54,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BindingDemo", "samples\Bind EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Skia", "Skia", "{3743B0F2-CC41-4F14-A8C8-267F579BF91E}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Android", "Android", "{7CF9789C-F1D3-4D0E-90E5-F1DF67A2753F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Android", "src\Android\Avalonia.Android\Avalonia.Android.csproj", "{7B92AF71-6287-4693-9DCB-BD5B6E927E23}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "iOS", "iOS", "{0CB0B92E-6CFF-4240-80A5-CCAFE75D91E1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.iOS", "src\iOS\Avalonia.iOS\Avalonia.iOS.csproj", "{4488AD85-1495-4809-9AA4-DDFE0A48527E}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.LeakTests", "tests\Avalonia.LeakTests\Avalonia.LeakTests.csproj", "{E1AA3DBF-9056-4530-9376-18119A7A3FFE}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.UnitTests", "tests\Avalonia.UnitTests\Avalonia.UnitTests.csproj", "{88060192-33D5-4932-B0F9-8BD2763E857D}" @@ -192,8 +184,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTestApp", "sampl EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.IntegrationTests.Appium", "tests\Avalonia.IntegrationTests.Appium\Avalonia.IntegrationTests.Appium.csproj", "{F2CE566B-E7F6-447A-AB1A-3F574A6FE43A}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Browser", "Browser", "{86A3F706-DC3C-43C6-BE1B-B98F5BAAA268}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsInteropTest", "samples\interop\WindowsInteropTest\WindowsInteropTest.csproj", "{26A98DA1-D89D-4A95-8152-349F404DA2E2}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ControlSamples", "samples\SampleControls\ControlSamples.csproj", "{A0D0A6A4-5C72-4ADA-9B27-621C7D94F270}" @@ -210,10 +200,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevGenerators", "src\tools\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SingleProjectSandbox", "samples\SingleProjectSandbox\SingleProjectSandbox.csproj", "{3B8519C1-2F51-4F12-A348-120AB91D4532}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Browser", "src\Browser\Avalonia.Browser\Avalonia.Browser.csproj", "{4A39637C-9338-4925-A4DB-D072E292EC78}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Browser.Blazor", "src\Browser\Avalonia.Browser.Blazor\Avalonia.Browser.Blazor.csproj", "{47F8530C-F19B-4B1A-B4D6-EB231522AE5D}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ControlCatalog.Browser", "samples\ControlCatalog.Browser\ControlCatalog.Browser.csproj", "{15B93A4C-1B46-43F6-B534-7B25B6E99932}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ControlCatalog.Browser.Blazor", "samples\ControlCatalog.Browser.Blazor\ControlCatalog.Browser.Blazor.csproj", "{90B08091-9BBD-4362-B712-E9F2CC62B218}" @@ -370,14 +356,6 @@ Global {08B3E6B9-1CD5-443C-9F61-6D49D1C5F162}.Debug|Any CPU.Build.0 = Debug|Any CPU {08B3E6B9-1CD5-443C-9F61-6D49D1C5F162}.Release|Any CPU.ActiveCfg = Release|Any CPU {08B3E6B9-1CD5-443C-9F61-6D49D1C5F162}.Release|Any CPU.Build.0 = Release|Any CPU - {7B92AF71-6287-4693-9DCB-BD5B6E927E23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7B92AF71-6287-4693-9DCB-BD5B6E927E23}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7B92AF71-6287-4693-9DCB-BD5B6E927E23}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7B92AF71-6287-4693-9DCB-BD5B6E927E23}.Release|Any CPU.Build.0 = Release|Any CPU - {4488AD85-1495-4809-9AA4-DDFE0A48527E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4488AD85-1495-4809-9AA4-DDFE0A48527E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4488AD85-1495-4809-9AA4-DDFE0A48527E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4488AD85-1495-4809-9AA4-DDFE0A48527E}.Release|Any CPU.Build.0 = Release|Any CPU {E1AA3DBF-9056-4530-9376-18119A7A3FFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E1AA3DBF-9056-4530-9376-18119A7A3FFE}.Debug|Any CPU.Build.0 = Debug|Any CPU {E1AA3DBF-9056-4530-9376-18119A7A3FFE}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -570,14 +548,6 @@ Global {3B8519C1-2F51-4F12-A348-120AB91D4532}.Debug|Any CPU.Build.0 = Debug|Any CPU {3B8519C1-2F51-4F12-A348-120AB91D4532}.Release|Any CPU.ActiveCfg = Release|Any CPU {3B8519C1-2F51-4F12-A348-120AB91D4532}.Release|Any CPU.Build.0 = Release|Any CPU - {4A39637C-9338-4925-A4DB-D072E292EC78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4A39637C-9338-4925-A4DB-D072E292EC78}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4A39637C-9338-4925-A4DB-D072E292EC78}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4A39637C-9338-4925-A4DB-D072E292EC78}.Release|Any CPU.Build.0 = Release|Any CPU - {47F8530C-F19B-4B1A-B4D6-EB231522AE5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {47F8530C-F19B-4B1A-B4D6-EB231522AE5D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {47F8530C-F19B-4B1A-B4D6-EB231522AE5D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {47F8530C-F19B-4B1A-B4D6-EB231522AE5D}.Release|Any CPU.Build.0 = Release|Any CPU {15B93A4C-1B46-43F6-B534-7B25B6E99932}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {15B93A4C-1B46-43F6-B534-7B25B6E99932}.Debug|Any CPU.Build.0 = Debug|Any CPU {15B93A4C-1B46-43F6-B534-7B25B6E99932}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -716,8 +686,6 @@ Global {6417E941-21BC-467B-A771-0DE389353CE6} = {8B6A8209-894F-4BA1-B880-965FD453982C} {8EF392D5-1416-45AA-9956-7CBBC3229E8A} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {08B3E6B9-1CD5-443C-9F61-6D49D1C5F162} = {9B9E3891-2366-4253-A952-D08BCEB71098} - {7B92AF71-6287-4693-9DCB-BD5B6E927E23} = {7CF9789C-F1D3-4D0E-90E5-F1DF67A2753F} - {4488AD85-1495-4809-9AA4-DDFE0A48527E} = {0CB0B92E-6CFF-4240-80A5-CCAFE75D91E1} {E1AA3DBF-9056-4530-9376-18119A7A3FFE} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {88060192-33D5-4932-B0F9-8BD2763E857D} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {410AC439-81A1-4EB5-B5E9-6A7FC6B77F4B} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} @@ -757,8 +725,6 @@ Global {EABE2161-989B-42BF-BD8D-1E34B20C21F1} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {1BBFAD42-B99E-47E0-B00A-A4BC6B6BB4BB} = {4ED8B739-6F4E-4CD4-B993-545E6B5CE637} {3B8519C1-2F51-4F12-A348-120AB91D4532} = {9B9E3891-2366-4253-A952-D08BCEB71098} - {4A39637C-9338-4925-A4DB-D072E292EC78} = {86A3F706-DC3C-43C6-BE1B-B98F5BAAA268} - {47F8530C-F19B-4B1A-B4D6-EB231522AE5D} = {86A3F706-DC3C-43C6-BE1B-B98F5BAAA268} {15B93A4C-1B46-43F6-B534-7B25B6E99932} = {9B9E3891-2366-4253-A952-D08BCEB71098} {90B08091-9BBD-4362-B712-E9F2CC62B218} = {9B9E3891-2366-4253-A952-D08BCEB71098} {75C47156-C5D8-44BC-A5A7-E8657C2248D6} = {9B9E3891-2366-4253-A952-D08BCEB71098} diff --git a/build/DevSingleProject.targets b/build/DevSingleProject.targets index f6b9b54d025..add015f287f 100644 --- a/build/DevSingleProject.targets +++ b/build/DevSingleProject.targets @@ -6,11 +6,11 @@ - - - - - + + + + + diff --git a/samples/ControlCatalog.Android/ControlCatalog.Android.csproj b/samples/ControlCatalog.Android/ControlCatalog.Android.csproj index 958725eed5b..660aeaf50ef 100644 --- a/samples/ControlCatalog.Android/ControlCatalog.Android.csproj +++ b/samples/ControlCatalog.Android/ControlCatalog.Android.csproj @@ -30,7 +30,6 @@ - diff --git a/samples/ControlCatalog.Browser.Blazor/ControlCatalog.Browser.Blazor.csproj b/samples/ControlCatalog.Browser.Blazor/ControlCatalog.Browser.Blazor.csproj index 2950028e687..63437e1d829 100644 --- a/samples/ControlCatalog.Browser.Blazor/ControlCatalog.Browser.Blazor.csproj +++ b/samples/ControlCatalog.Browser.Blazor/ControlCatalog.Browser.Blazor.csproj @@ -15,7 +15,6 @@ - diff --git a/samples/ControlCatalog.Browser/ControlCatalog.Browser.csproj b/samples/ControlCatalog.Browser/ControlCatalog.Browser.csproj index b921945f256..c1799f269e8 100644 --- a/samples/ControlCatalog.Browser/ControlCatalog.Browser.csproj +++ b/samples/ControlCatalog.Browser/ControlCatalog.Browser.csproj @@ -9,7 +9,6 @@ - @@ -17,7 +16,7 @@ A workaround for VS and Rider being dumber than a rock when it comes to build dependency analysis Also see https://youtrack.jetbrains.com/issue/RIDER-107175/Rider-doesnt-update-generate-transitive-Content-dependencies --> - + diff --git a/samples/ControlCatalog.iOS/ControlCatalog.iOS.csproj b/samples/ControlCatalog.iOS/ControlCatalog.iOS.csproj index 75c244711b1..2426a81f47d 100644 --- a/samples/ControlCatalog.iOS/ControlCatalog.iOS.csproj +++ b/samples/ControlCatalog.iOS/ControlCatalog.iOS.csproj @@ -7,7 +7,6 @@ $(AvsMinSupportedIOSVersion) - diff --git a/samples/SafeAreaDemo.Android/SafeAreaDemo.Android.csproj b/samples/SafeAreaDemo.Android/SafeAreaDemo.Android.csproj index 413bb8333ea..756b2b19530 100644 --- a/samples/SafeAreaDemo.Android/SafeAreaDemo.Android.csproj +++ b/samples/SafeAreaDemo.Android/SafeAreaDemo.Android.csproj @@ -13,7 +13,6 @@ - diff --git a/samples/SafeAreaDemo.iOS/SafeAreaDemo.iOS.csproj b/samples/SafeAreaDemo.iOS/SafeAreaDemo.iOS.csproj index 2f16e335de7..90b7819a028 100644 --- a/samples/SafeAreaDemo.iOS/SafeAreaDemo.iOS.csproj +++ b/samples/SafeAreaDemo.iOS/SafeAreaDemo.iOS.csproj @@ -9,6 +9,5 @@ - From 73b70ffc08d7ea6955329eb16e14dfc92c5aadf1 Mon Sep 17 00:00:00 2001 From: lindexi Date: Mon, 16 Mar 2026 16:45:17 +0800 Subject: [PATCH 19/21] =?UTF-8?q?Revert=20"=E5=B0=9D=E8=AF=95=E5=87=8F?= =?UTF-8?q?=E5=B0=91=E9=A1=B9=E7=9B=AE=E4=BF=AE=E5=A4=8D=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E4=BD=86=E6=B2=A1=E6=9C=89=E6=88=90=E5=8A=9F"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e324fd5477a58b85b90d3206da02e1fde765e908. --- Avalonia.sln | 38 ++++++++++++++++++- build/DevSingleProject.targets | 10 ++--- .../ControlCatalog.Android.csproj | 1 + .../ControlCatalog.Browser.Blazor.csproj | 1 + .../ControlCatalog.Browser.csproj | 3 +- .../ControlCatalog.iOS.csproj | 1 + .../SafeAreaDemo.Android.csproj | 1 + .../SafeAreaDemo.iOS/SafeAreaDemo.iOS.csproj | 1 + 8 files changed, 48 insertions(+), 8 deletions(-) diff --git a/Avalonia.sln b/Avalonia.sln index d6743493d28..a0314b1c330 100644 --- a/Avalonia.sln +++ b/Avalonia.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 18 -VisualStudioVersion = 18.3.11520.95 d18.3 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Base", "src\Avalonia.Base\Avalonia.Base.csproj", "{B09B78D8-9B26-48B0-9149-D64A2F120F3F}" EndProject @@ -54,6 +54,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BindingDemo", "samples\Bind EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Skia", "Skia", "{3743B0F2-CC41-4F14-A8C8-267F579BF91E}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Android", "Android", "{7CF9789C-F1D3-4D0E-90E5-F1DF67A2753F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Android", "src\Android\Avalonia.Android\Avalonia.Android.csproj", "{7B92AF71-6287-4693-9DCB-BD5B6E927E23}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "iOS", "iOS", "{0CB0B92E-6CFF-4240-80A5-CCAFE75D91E1}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.iOS", "src\iOS\Avalonia.iOS\Avalonia.iOS.csproj", "{4488AD85-1495-4809-9AA4-DDFE0A48527E}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.LeakTests", "tests\Avalonia.LeakTests\Avalonia.LeakTests.csproj", "{E1AA3DBF-9056-4530-9376-18119A7A3FFE}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.UnitTests", "tests\Avalonia.UnitTests\Avalonia.UnitTests.csproj", "{88060192-33D5-4932-B0F9-8BD2763E857D}" @@ -184,6 +192,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTestApp", "sampl EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.IntegrationTests.Appium", "tests\Avalonia.IntegrationTests.Appium\Avalonia.IntegrationTests.Appium.csproj", "{F2CE566B-E7F6-447A-AB1A-3F574A6FE43A}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Browser", "Browser", "{86A3F706-DC3C-43C6-BE1B-B98F5BAAA268}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsInteropTest", "samples\interop\WindowsInteropTest\WindowsInteropTest.csproj", "{26A98DA1-D89D-4A95-8152-349F404DA2E2}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ControlSamples", "samples\SampleControls\ControlSamples.csproj", "{A0D0A6A4-5C72-4ADA-9B27-621C7D94F270}" @@ -200,6 +210,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevGenerators", "src\tools\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SingleProjectSandbox", "samples\SingleProjectSandbox\SingleProjectSandbox.csproj", "{3B8519C1-2F51-4F12-A348-120AB91D4532}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Browser", "src\Browser\Avalonia.Browser\Avalonia.Browser.csproj", "{4A39637C-9338-4925-A4DB-D072E292EC78}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Browser.Blazor", "src\Browser\Avalonia.Browser.Blazor\Avalonia.Browser.Blazor.csproj", "{47F8530C-F19B-4B1A-B4D6-EB231522AE5D}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ControlCatalog.Browser", "samples\ControlCatalog.Browser\ControlCatalog.Browser.csproj", "{15B93A4C-1B46-43F6-B534-7B25B6E99932}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ControlCatalog.Browser.Blazor", "samples\ControlCatalog.Browser.Blazor\ControlCatalog.Browser.Blazor.csproj", "{90B08091-9BBD-4362-B712-E9F2CC62B218}" @@ -356,6 +370,14 @@ Global {08B3E6B9-1CD5-443C-9F61-6D49D1C5F162}.Debug|Any CPU.Build.0 = Debug|Any CPU {08B3E6B9-1CD5-443C-9F61-6D49D1C5F162}.Release|Any CPU.ActiveCfg = Release|Any CPU {08B3E6B9-1CD5-443C-9F61-6D49D1C5F162}.Release|Any CPU.Build.0 = Release|Any CPU + {7B92AF71-6287-4693-9DCB-BD5B6E927E23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7B92AF71-6287-4693-9DCB-BD5B6E927E23}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7B92AF71-6287-4693-9DCB-BD5B6E927E23}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7B92AF71-6287-4693-9DCB-BD5B6E927E23}.Release|Any CPU.Build.0 = Release|Any CPU + {4488AD85-1495-4809-9AA4-DDFE0A48527E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4488AD85-1495-4809-9AA4-DDFE0A48527E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4488AD85-1495-4809-9AA4-DDFE0A48527E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4488AD85-1495-4809-9AA4-DDFE0A48527E}.Release|Any CPU.Build.0 = Release|Any CPU {E1AA3DBF-9056-4530-9376-18119A7A3FFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E1AA3DBF-9056-4530-9376-18119A7A3FFE}.Debug|Any CPU.Build.0 = Debug|Any CPU {E1AA3DBF-9056-4530-9376-18119A7A3FFE}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -548,6 +570,14 @@ Global {3B8519C1-2F51-4F12-A348-120AB91D4532}.Debug|Any CPU.Build.0 = Debug|Any CPU {3B8519C1-2F51-4F12-A348-120AB91D4532}.Release|Any CPU.ActiveCfg = Release|Any CPU {3B8519C1-2F51-4F12-A348-120AB91D4532}.Release|Any CPU.Build.0 = Release|Any CPU + {4A39637C-9338-4925-A4DB-D072E292EC78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4A39637C-9338-4925-A4DB-D072E292EC78}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4A39637C-9338-4925-A4DB-D072E292EC78}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4A39637C-9338-4925-A4DB-D072E292EC78}.Release|Any CPU.Build.0 = Release|Any CPU + {47F8530C-F19B-4B1A-B4D6-EB231522AE5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {47F8530C-F19B-4B1A-B4D6-EB231522AE5D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {47F8530C-F19B-4B1A-B4D6-EB231522AE5D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {47F8530C-F19B-4B1A-B4D6-EB231522AE5D}.Release|Any CPU.Build.0 = Release|Any CPU {15B93A4C-1B46-43F6-B534-7B25B6E99932}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {15B93A4C-1B46-43F6-B534-7B25B6E99932}.Debug|Any CPU.Build.0 = Debug|Any CPU {15B93A4C-1B46-43F6-B534-7B25B6E99932}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -686,6 +716,8 @@ Global {6417E941-21BC-467B-A771-0DE389353CE6} = {8B6A8209-894F-4BA1-B880-965FD453982C} {8EF392D5-1416-45AA-9956-7CBBC3229E8A} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {08B3E6B9-1CD5-443C-9F61-6D49D1C5F162} = {9B9E3891-2366-4253-A952-D08BCEB71098} + {7B92AF71-6287-4693-9DCB-BD5B6E927E23} = {7CF9789C-F1D3-4D0E-90E5-F1DF67A2753F} + {4488AD85-1495-4809-9AA4-DDFE0A48527E} = {0CB0B92E-6CFF-4240-80A5-CCAFE75D91E1} {E1AA3DBF-9056-4530-9376-18119A7A3FFE} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {88060192-33D5-4932-B0F9-8BD2763E857D} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {410AC439-81A1-4EB5-B5E9-6A7FC6B77F4B} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} @@ -725,6 +757,8 @@ Global {EABE2161-989B-42BF-BD8D-1E34B20C21F1} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {1BBFAD42-B99E-47E0-B00A-A4BC6B6BB4BB} = {4ED8B739-6F4E-4CD4-B993-545E6B5CE637} {3B8519C1-2F51-4F12-A348-120AB91D4532} = {9B9E3891-2366-4253-A952-D08BCEB71098} + {4A39637C-9338-4925-A4DB-D072E292EC78} = {86A3F706-DC3C-43C6-BE1B-B98F5BAAA268} + {47F8530C-F19B-4B1A-B4D6-EB231522AE5D} = {86A3F706-DC3C-43C6-BE1B-B98F5BAAA268} {15B93A4C-1B46-43F6-B534-7B25B6E99932} = {9B9E3891-2366-4253-A952-D08BCEB71098} {90B08091-9BBD-4362-B712-E9F2CC62B218} = {9B9E3891-2366-4253-A952-D08BCEB71098} {75C47156-C5D8-44BC-A5A7-E8657C2248D6} = {9B9E3891-2366-4253-A952-D08BCEB71098} diff --git a/build/DevSingleProject.targets b/build/DevSingleProject.targets index add015f287f..f6b9b54d025 100644 --- a/build/DevSingleProject.targets +++ b/build/DevSingleProject.targets @@ -6,11 +6,11 @@ - - - - - + + + + + diff --git a/samples/ControlCatalog.Android/ControlCatalog.Android.csproj b/samples/ControlCatalog.Android/ControlCatalog.Android.csproj index 660aeaf50ef..958725eed5b 100644 --- a/samples/ControlCatalog.Android/ControlCatalog.Android.csproj +++ b/samples/ControlCatalog.Android/ControlCatalog.Android.csproj @@ -30,6 +30,7 @@ + diff --git a/samples/ControlCatalog.Browser.Blazor/ControlCatalog.Browser.Blazor.csproj b/samples/ControlCatalog.Browser.Blazor/ControlCatalog.Browser.Blazor.csproj index 63437e1d829..2950028e687 100644 --- a/samples/ControlCatalog.Browser.Blazor/ControlCatalog.Browser.Blazor.csproj +++ b/samples/ControlCatalog.Browser.Blazor/ControlCatalog.Browser.Blazor.csproj @@ -15,6 +15,7 @@ + diff --git a/samples/ControlCatalog.Browser/ControlCatalog.Browser.csproj b/samples/ControlCatalog.Browser/ControlCatalog.Browser.csproj index c1799f269e8..b921945f256 100644 --- a/samples/ControlCatalog.Browser/ControlCatalog.Browser.csproj +++ b/samples/ControlCatalog.Browser/ControlCatalog.Browser.csproj @@ -9,6 +9,7 @@ + @@ -16,7 +17,7 @@ A workaround for VS and Rider being dumber than a rock when it comes to build dependency analysis Also see https://youtrack.jetbrains.com/issue/RIDER-107175/Rider-doesnt-update-generate-transitive-Content-dependencies --> - + diff --git a/samples/ControlCatalog.iOS/ControlCatalog.iOS.csproj b/samples/ControlCatalog.iOS/ControlCatalog.iOS.csproj index 2426a81f47d..75c244711b1 100644 --- a/samples/ControlCatalog.iOS/ControlCatalog.iOS.csproj +++ b/samples/ControlCatalog.iOS/ControlCatalog.iOS.csproj @@ -7,6 +7,7 @@ $(AvsMinSupportedIOSVersion) + diff --git a/samples/SafeAreaDemo.Android/SafeAreaDemo.Android.csproj b/samples/SafeAreaDemo.Android/SafeAreaDemo.Android.csproj index 756b2b19530..413bb8333ea 100644 --- a/samples/SafeAreaDemo.Android/SafeAreaDemo.Android.csproj +++ b/samples/SafeAreaDemo.Android/SafeAreaDemo.Android.csproj @@ -13,6 +13,7 @@ + diff --git a/samples/SafeAreaDemo.iOS/SafeAreaDemo.iOS.csproj b/samples/SafeAreaDemo.iOS/SafeAreaDemo.iOS.csproj index 90b7819a028..2f16e335de7 100644 --- a/samples/SafeAreaDemo.iOS/SafeAreaDemo.iOS.csproj +++ b/samples/SafeAreaDemo.iOS/SafeAreaDemo.iOS.csproj @@ -9,5 +9,6 @@ + From bc0cc949bc246bd442964a9cdfd57da4ab2da8f9 Mon Sep 17 00:00:00 2001 From: lindexi Date: Mon, 16 Mar 2026 17:11:09 +0800 Subject: [PATCH 20/21] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dirs.proj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dirs.proj b/dirs.proj index 28a91c8b684..3a9f2ed9fce 100644 --- a/dirs.proj +++ b/dirs.proj @@ -17,9 +17,10 @@ - + + From bf0ccc51a6c1147f72088daae729dfb1a80e62ab Mon Sep 17 00:00:00 2001 From: lindexi Date: Mon, 16 Mar 2026 17:14:20 +0800 Subject: [PATCH 21/21] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nukebuild/BuildParameters.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nukebuild/BuildParameters.cs b/nukebuild/BuildParameters.cs index 41e075a64c9..2bda94c4352 100644 --- a/nukebuild/BuildParameters.cs +++ b/nukebuild/BuildParameters.cs @@ -57,7 +57,7 @@ public class BuildParameters public bool IsNuGetRelease { get; } public bool PublishTestResults { get; } public string Version { get; set; } - public const string LocalBuildVersion = "9999.0.0-localbuild"; + public const string LocalBuildVersion = "11.3.6-hotfix.4"; public bool IsPackingToLocalCache { get; private set; } public AbsolutePath ArtifactsDir { get; }