Browse Source
Merge pull request #4478 from AvaloniaUI/fixes/4477-autosize-secondary-screen
Fix auto-sizing on secondary monitors on win32.
pull/4482/head
danwalmsley
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
5 additions and
8 deletions
-
src/Avalonia.Controls/Window.cs
-
src/Avalonia.Controls/WindowBase.cs
|
|
|
@ -652,8 +652,8 @@ namespace Avalonia.Controls |
|
|
|
|
|
|
|
PlatformImpl?.Show(); |
|
|
|
Renderer?.Start(); |
|
|
|
SetWindowStartupLocation(Owner?.PlatformImpl); |
|
|
|
} |
|
|
|
SetWindowStartupLocation(Owner?.PlatformImpl); |
|
|
|
OnOpened(EventArgs.Empty); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -39,6 +39,7 @@ namespace Avalonia.Controls |
|
|
|
public static readonly StyledProperty<bool> TopmostProperty = |
|
|
|
AvaloniaProperty.Register<WindowBase, bool>(nameof(Topmost)); |
|
|
|
|
|
|
|
private int _autoSizing; |
|
|
|
private bool _hasExecutedInitialLayoutPass; |
|
|
|
private bool _isActive; |
|
|
|
private bool _ignoreVisibilityChange; |
|
|
|
@ -97,11 +98,7 @@ namespace Avalonia.Controls |
|
|
|
/// <summary>
|
|
|
|
/// Whether an auto-size operation is in progress.
|
|
|
|
/// </summary>
|
|
|
|
protected bool AutoSizing |
|
|
|
{ |
|
|
|
get; |
|
|
|
private set; |
|
|
|
} |
|
|
|
protected bool AutoSizing => _autoSizing > 0; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the owner of the window.
|
|
|
|
@ -186,8 +183,8 @@ namespace Avalonia.Controls |
|
|
|
/// </remarks>
|
|
|
|
protected IDisposable BeginAutoSizing() |
|
|
|
{ |
|
|
|
AutoSizing = true; |
|
|
|
return Disposable.Create(() => AutoSizing = false); |
|
|
|
++_autoSizing; |
|
|
|
return Disposable.Create(() => --_autoSizing); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|