diff --git a/native/Avalonia.Native/src/OSX/window.mm b/native/Avalonia.Native/src/OSX/window.mm
index 6bd09fe08b..76eca330a9 100644
--- a/native/Avalonia.Native/src/OSX/window.mm
+++ b/native/Avalonia.Native/src/OSX/window.mm
@@ -202,7 +202,7 @@ public:
}
}
- virtual HRESULT GetTotalSize(AvnSize* ret) override
+ virtual HRESULT GetFrameSize(AvnSize* ret) override
{
@autoreleasepool
{
diff --git a/src/Android/Avalonia.Android/Platform/SkiaPlatform/TopLevelImpl.cs b/src/Android/Avalonia.Android/Platform/SkiaPlatform/TopLevelImpl.cs
index 8b732a92da..1e1e7066d4 100644
--- a/src/Android/Avalonia.Android/Platform/SkiaPlatform/TopLevelImpl.cs
+++ b/src/Android/Avalonia.Android/Platform/SkiaPlatform/TopLevelImpl.cs
@@ -55,7 +55,7 @@ namespace Avalonia.Android.Platform.SkiaPlatform
public virtual Size ClientSize => Size.ToSize(RenderScaling);
- public Size TotalSize => ClientSize;
+ public Size FrameSize => ClientSize;
public IMouseDevice MouseDevice { get; } = new MouseDevice();
diff --git a/src/Avalonia.Controls/ApiCompatBaseline.txt b/src/Avalonia.Controls/ApiCompatBaseline.txt
index 166a005e4d..f81506252a 100644
--- a/src/Avalonia.Controls/ApiCompatBaseline.txt
+++ b/src/Avalonia.Controls/ApiCompatBaseline.txt
@@ -11,6 +11,6 @@ EnumValuesMustMatch : Enum value 'Avalonia.Platform.ExtendClientAreaChromeHints
InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.Platform.ITopLevelImpl.SetCursor(Avalonia.Platform.ICursorImpl)' is present in the implementation but not in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.Platform.ITopLevelImpl.SetCursor(Avalonia.Platform.IPlatformHandle)' is present in the contract but not in the implementation.
MembersMustExist : Member 'public void Avalonia.Platform.ITopLevelImpl.SetCursor(Avalonia.Platform.IPlatformHandle)' does not exist in the implementation but it does exist in the contract.
-InterfacesShouldHaveSameMembers : Interface member 'public Avalonia.Size Avalonia.Platform.ITopLevelImpl.TotalSize' is present in the implementation but not in the contract.
-InterfacesShouldHaveSameMembers : Interface member 'public Avalonia.Size Avalonia.Platform.ITopLevelImpl.TotalSize.get()' is present in the implementation but not in the contract.
+InterfacesShouldHaveSameMembers : Interface member 'public Avalonia.Size Avalonia.Platform.ITopLevelImpl.FrameSize' is present in the implementation but not in the contract.
+InterfacesShouldHaveSameMembers : Interface member 'public Avalonia.Size Avalonia.Platform.ITopLevelImpl.FrameSize.get()' is present in the implementation but not in the contract.
Total Issues: 14
diff --git a/src/Avalonia.Controls/Embedding/Offscreen/OffscreenTopLevelImpl.cs b/src/Avalonia.Controls/Embedding/Offscreen/OffscreenTopLevelImpl.cs
index cb0c5d94e5..9242264470 100644
--- a/src/Avalonia.Controls/Embedding/Offscreen/OffscreenTopLevelImpl.cs
+++ b/src/Avalonia.Controls/Embedding/Offscreen/OffscreenTopLevelImpl.cs
@@ -35,15 +35,7 @@ namespace Avalonia.Controls.Embedding.Offscreen
}
}
- public Size TotalSize
- {
- get { return _clientSize; }
- set
- {
- _clientSize = value;
- Resized?.Invoke(value);
- }
- }
+ public Size FrameSize => _clientSize;
public double RenderScaling
{
diff --git a/src/Avalonia.Controls/Platform/ITopLevelImpl.cs b/src/Avalonia.Controls/Platform/ITopLevelImpl.cs
index 546184f8a6..d9fb22422a 100644
--- a/src/Avalonia.Controls/Platform/ITopLevelImpl.cs
+++ b/src/Avalonia.Controls/Platform/ITopLevelImpl.cs
@@ -25,7 +25,7 @@ namespace Avalonia.Platform
///
/// Gets the total size of the toplevel, excluding shadows.
///
- Size TotalSize { get; }
+ Size FrameSize { get; }
///
/// Gets the scaling factor for the toplevel. This is used for rendering.
diff --git a/src/Avalonia.Controls/TopLevel.cs b/src/Avalonia.Controls/TopLevel.cs
index e2d9e7e697..65bd2b8d2f 100644
--- a/src/Avalonia.Controls/TopLevel.cs
+++ b/src/Avalonia.Controls/TopLevel.cs
@@ -43,10 +43,10 @@ namespace Avalonia.Controls
AvaloniaProperty.RegisterDirect(nameof(ClientSize), o => o.ClientSize);
///
- /// Defines the property.
+ /// Defines the property.
///
- public static readonly DirectProperty TotalSizeProperty =
- AvaloniaProperty.RegisterDirect(nameof(TotalSize), o => o.TotalSize);
+ public static readonly DirectProperty FrameSizeProperty =
+ AvaloniaProperty.RegisterDirect(nameof(FrameSize), o => o.FrameSize);
///
/// Defines the property.
@@ -80,7 +80,7 @@ namespace Avalonia.Controls
private readonly IPlatformRenderInterface _renderInterface;
private readonly IGlobalStyles _globalStyles;
private Size _clientSize;
- private Size _totalSize;
+ private Size _frameSize;
private WindowTransparencyLevel _actualTransparencyLevel;
private ILayoutManager _layoutManager;
private Border _transparencyFallbackBorder;
@@ -91,7 +91,6 @@ namespace Avalonia.Controls
static TopLevel()
{
AffectsMeasure(ClientSizeProperty);
- AffectsMeasure(TotalSizeProperty);
TransparencyLevelHintProperty.Changed.AddClassHandler(
(tl, e) =>
@@ -202,17 +201,13 @@ namespace Avalonia.Controls
public Size ClientSize
{
get { return _clientSize; }
- protected set
- {
- SetAndRaise(ClientSizeProperty, ref _clientSize, value);
- SetAndRaise(TotalSizeProperty, ref _totalSize, PlatformImpl.TotalSize);
- }
+ protected set { SetAndRaise(ClientSizeProperty, ref _clientSize, value); }
}
///
/// Gets or sets the total size of the window.
///
- public Size TotalSize => _totalSize;
+ public Size FrameSize => _frameSize;
///
/// Gets or sets the that the TopLevel should use when possible.
@@ -462,6 +457,14 @@ namespace Avalonia.Controls
/// The event args.
protected virtual void OnClosed(EventArgs e) => Closed?.Invoke(this, e);
+ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
+ {
+ if (change.Property == ClientSizeProperty)
+ {
+ SetAndRaise(FrameSizeProperty, ref _frameSize, PlatformImpl.FrameSize);
+ }
+ }
+
///
/// Tries to get a service from an , logging a
/// warning if not found.
diff --git a/src/Avalonia.Controls/Window.cs b/src/Avalonia.Controls/Window.cs
index 700c3d9bad..cc8e27c3ec 100644
--- a/src/Avalonia.Controls/Window.cs
+++ b/src/Avalonia.Controls/Window.cs
@@ -950,6 +950,7 @@ namespace Avalonia.Controls
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
{
+ base.OnPropertyChanged(change);
if (change.Property == SystemDecorationsProperty)
{
var typedNewValue = change.NewValue.GetValueOrDefault();
diff --git a/src/Avalonia.DesignerSupport/Remote/Stubs.cs b/src/Avalonia.DesignerSupport/Remote/Stubs.cs
index 91bc93d897..aaaaedd2a6 100644
--- a/src/Avalonia.DesignerSupport/Remote/Stubs.cs
+++ b/src/Avalonia.DesignerSupport/Remote/Stubs.cs
@@ -21,7 +21,7 @@ namespace Avalonia.DesignerSupport.Remote
public IPlatformHandle Handle { get; }
public Size MaxAutoSizeHint { get; }
public Size ClientSize { get; }
- public Size TotalSize => ClientSize;
+ public Size FrameSize => ClientSize;
public double RenderScaling { get; } = 1.0;
public double DesktopScaling => 1.0;
public IEnumerable