|
|
|
@ -872,10 +872,10 @@ namespace Avalonia.Controls |
|
|
|
|
|
|
|
var scaling = owner?.DesktopScaling ?? PlatformImpl?.DesktopScaling ?? 1; |
|
|
|
|
|
|
|
// TODO: We really need non-client size here.
|
|
|
|
var rect = new PixelRect( |
|
|
|
PixelPoint.Origin, |
|
|
|
PixelSize.FromSize(ClientSize, scaling)); |
|
|
|
// Use frame size, falling back to client size if the platform can't give it to us.
|
|
|
|
var rect = FrameSize.HasValue ? |
|
|
|
new PixelRect(PixelSize.FromSize(FrameSize.Value, scaling)) : |
|
|
|
new PixelRect(PixelSize.FromSize(ClientSize, scaling)); |
|
|
|
|
|
|
|
if (startupLocation == WindowStartupLocation.CenterScreen) |
|
|
|
{ |
|
|
|
@ -992,28 +992,28 @@ namespace Avalonia.Controls |
|
|
|
/// <inheritdoc/>
|
|
|
|
protected sealed override void HandleResized(Size clientSize, PlatformResizeReason reason) |
|
|
|
{ |
|
|
|
if (ClientSize == clientSize) |
|
|
|
return; |
|
|
|
|
|
|
|
var sizeToContent = SizeToContent; |
|
|
|
|
|
|
|
// If auto-sizing is enabled, and the resize came from a user resize (or the reason was
|
|
|
|
// unspecified) then turn off auto-resizing for any window dimension that is not equal
|
|
|
|
// to the requested size.
|
|
|
|
if (sizeToContent != SizeToContent.Manual && |
|
|
|
CanResize && |
|
|
|
reason == PlatformResizeReason.Unspecified || |
|
|
|
reason == PlatformResizeReason.User) |
|
|
|
if (ClientSize != clientSize || double.IsNaN(Width) || double.IsNaN(Height)) |
|
|
|
{ |
|
|
|
if (clientSize.Width != ClientSize.Width) |
|
|
|
sizeToContent &= ~SizeToContent.Width; |
|
|
|
if (clientSize.Height != ClientSize.Height) |
|
|
|
sizeToContent &= ~SizeToContent.Height; |
|
|
|
SizeToContent = sizeToContent; |
|
|
|
} |
|
|
|
var sizeToContent = SizeToContent; |
|
|
|
|
|
|
|
// If auto-sizing is enabled, and the resize came from a user resize (or the reason was
|
|
|
|
// unspecified) then turn off auto-resizing for any window dimension that is not equal
|
|
|
|
// to the requested size.
|
|
|
|
if (sizeToContent != SizeToContent.Manual && |
|
|
|
CanResize && |
|
|
|
reason == PlatformResizeReason.Unspecified || |
|
|
|
reason == PlatformResizeReason.User) |
|
|
|
{ |
|
|
|
if (clientSize.Width != ClientSize.Width) |
|
|
|
sizeToContent &= ~SizeToContent.Width; |
|
|
|
if (clientSize.Height != ClientSize.Height) |
|
|
|
sizeToContent &= ~SizeToContent.Height; |
|
|
|
SizeToContent = sizeToContent; |
|
|
|
} |
|
|
|
|
|
|
|
Width = clientSize.Width; |
|
|
|
Height = clientSize.Height; |
|
|
|
Width = clientSize.Width; |
|
|
|
Height = clientSize.Height; |
|
|
|
} |
|
|
|
|
|
|
|
base.HandleResized(clientSize, reason); |
|
|
|
} |
|
|
|
|