From 4fe8e41646e5a483780a76726ee8a590975c2f7f Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 14 May 2020 11:36:58 -0300 Subject: [PATCH] add x11 implementation. --- src/Avalonia.X11/X11Window.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/Avalonia.X11/X11Window.cs b/src/Avalonia.X11/X11Window.cs index 1b3d1a7dda..eb1759aadd 100644 --- a/src/Avalonia.X11/X11Window.cs +++ b/src/Avalonia.X11/X11Window.cs @@ -44,6 +44,8 @@ namespace Avalonia.X11 private HashSet _transientChildren = new HashSet(); private X11Window _transientParent; private double? _scalingOverride; + private bool _disabled; + public object SyncRoot { get; } = new object(); class InputEventContainer @@ -773,6 +775,11 @@ namespace Avalonia.X11 bool ActivateTransientChildIfNeeded() { + if(_disabled) + { + return false; + } + if (_transientChildren.Count == 0) return false; var child = _transientChildren.First(); @@ -1035,12 +1042,18 @@ namespace Avalonia.X11 ChangeWMAtoms(value, _x11.Atoms._NET_WM_STATE_ABOVE); } - public void ShowDialog(IWindowImpl parent) + public void SetParent(IWindowImpl parent) { SetTransientParent((X11Window)parent); - ShowCore(); } + public void SetEnabled(bool enable) + { + _disabled = !enable; + } + + public Action GotInputWhenDisabled { get; set; } + public void SetIcon(IWindowIconImpl icon) { if (icon != null)