修复 全屏后 窗口仍可拖拽的问题

https://github.com/irihitech/Ursa.Avalonia/issues/298
This commit is contained in:
杨劼
2024-07-19 18:23:11 +08:00
parent 36831f5956
commit cd224be8ac

View File

@@ -49,6 +49,11 @@ public class TitleBar: ContentControl
private void OnPointerPressed(object sender, PointerPressedEventArgs e)
{
if(_visualRoot is not null
&& _visualRoot.WindowState == WindowState.FullScreen)
{
return;
}
if (e.GetCurrentPoint(this).Properties.IsLeftButtonPressed)
{
if (e.ClickCount < 2)
@@ -62,7 +67,8 @@ public class TitleBar: ContentControl
{
if (_visualRoot is not null)
{
if (_visualRoot.WindowState == WindowState.Maximized)
if (_visualRoot.WindowState == WindowState.Maximized
|| _visualRoot.WindowState == WindowState.FullScreen)
{
_visualRoot.WindowState = WindowState.Normal;
}