From 7dba3c80cc882c26b99e458c19aea43bd976257a Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Mon, 18 May 2026 21:07:54 +0500 Subject: [PATCH] Platform event to toggle drawn decorations state (#21388) --- src/Avalonia.Controls/Platform/IWindowImpl.cs | 12 ++++++++++++ src/Avalonia.Controls/Window.cs | 1 + 2 files changed, 13 insertions(+) diff --git a/src/Avalonia.Controls/Platform/IWindowImpl.cs b/src/Avalonia.Controls/Platform/IWindowImpl.cs index 888748fd89..8ca7e02a46 100644 --- a/src/Avalonia.Controls/Platform/IWindowImpl.cs +++ b/src/Avalonia.Controls/Platform/IWindowImpl.cs @@ -111,6 +111,18 @@ namespace Avalonia.Platform /// PlatformRequestedDrawnDecoration RequestedDrawnDecorations { get; } + /// + /// Triggered when decorations request from platform got changed + /// + Action? DrawnDecorationsRequestChanged + { + get => null; + set + { + + } + } + /// /// Gets a thickness that describes the amount each side of the non-client area extends into the client area. /// It includes the titlebar. diff --git a/src/Avalonia.Controls/Window.cs b/src/Avalonia.Controls/Window.cs index 217147094f..901431d835 100644 --- a/src/Avalonia.Controls/Window.cs +++ b/src/Avalonia.Controls/Window.cs @@ -255,6 +255,7 @@ namespace Avalonia.Controls impl.Closing = HandleClosing; impl.GotInputWhenDisabled = OnGotInputWhenDisabled; impl.WindowStateChanged = HandleWindowStateChanged; + impl.DrawnDecorationsRequestChanged = UpdateDrawnDecorations; _maxPlatformClientSize = PlatformImpl?.MaxAutoSizeHint ?? default(Size); impl.ExtendClientAreaToDecorationsChanged = ExtendClientAreaToDecorationsChanged; impl.AllowedWindowActionsChanged = OnAllowedWindowActionsChanged;