|
|
|
@ -64,7 +64,7 @@ namespace Avalonia.X11 |
|
|
|
private RawEventGrouper? _rawEventGrouper; |
|
|
|
private bool _useRenderWindow = false; |
|
|
|
private bool _usePositioningFlags = false; |
|
|
|
private X11FocusProxy _focusProxy; |
|
|
|
private X11FocusProxy? _focusProxy; |
|
|
|
|
|
|
|
private enum XSyncState |
|
|
|
{ |
|
|
|
@ -158,8 +158,13 @@ namespace Avalonia.X11 |
|
|
|
_renderHandle = _handle; |
|
|
|
|
|
|
|
Handle = new PlatformHandle(_handle, "XID"); |
|
|
|
_focusProxy = new X11FocusProxy(platform, _handle, OnEvent); |
|
|
|
SetWmClass(_focusProxy._handle, "FocusProxy"); |
|
|
|
|
|
|
|
if (platform.Options.EnableInputFocusProxy) |
|
|
|
{ |
|
|
|
_focusProxy = new X11FocusProxy(platform, _handle, OnEvent); |
|
|
|
SetWmClass(_focusProxy._handle, "FocusProxy"); |
|
|
|
} |
|
|
|
|
|
|
|
_realSize = new PixelSize(defaultWidth, defaultHeight); |
|
|
|
platform.Windows[_handle] = OnEvent; |
|
|
|
XEventMask ignoredMask = XEventMask.SubstructureRedirectMask |
|
|
|
@ -214,9 +219,14 @@ namespace Avalonia.X11 |
|
|
|
_nativeMenuExporter = DBusMenuExporter.TryCreateTopLevelNativeMenu(_handle); |
|
|
|
_nativeControlHost = new X11NativeControlHost(_platform, this); |
|
|
|
InitializeIme(); |
|
|
|
|
|
|
|
var data = new List<IntPtr> { _x11.Atoms.WM_DELETE_WINDOW, _x11.Atoms._NET_WM_SYNC_REQUEST }; |
|
|
|
|
|
|
|
if(platform.Options.EnableInputFocusProxy) |
|
|
|
data.Add(_x11.Atoms.WM_TAKE_FOCUS); |
|
|
|
|
|
|
|
XChangeProperty(_x11.Display, _handle, _x11.Atoms.WM_PROTOCOLS, _x11.Atoms.XA_ATOM, 32, |
|
|
|
PropertyMode.Replace, new[] { _x11.Atoms.WM_DELETE_WINDOW, _x11.Atoms.WM_TAKE_FOCUS, _x11.Atoms._NET_WM_SYNC_REQUEST }, 3); |
|
|
|
PropertyMode.Replace, data.ToArray(), data.Count); |
|
|
|
|
|
|
|
if (_x11.HasXSync) |
|
|
|
{ |
|
|
|
@ -564,7 +574,7 @@ namespace Avalonia.X11 |
|
|
|
_xSyncValue.Hi = ev.ClientMessageEvent.ptr4.ToInt32(); |
|
|
|
_xSyncState = XSyncState.WaitConfigure; |
|
|
|
} |
|
|
|
else if (ev.ClientMessageEvent.ptr1 == _x11.Atoms.WM_TAKE_FOCUS) |
|
|
|
else if (ev.ClientMessageEvent.ptr1 == _x11.Atoms.WM_TAKE_FOCUS && _platform.Options.EnableInputFocusProxy) |
|
|
|
{ |
|
|
|
IntPtr time = ev.ClientMessageEvent.ptr2; |
|
|
|
XSetInputFocus(_x11.Display, _focusProxy._handle, RevertTo.Parent, time); |
|
|
|
@ -953,7 +963,7 @@ namespace Avalonia.X11 |
|
|
|
_renderHandle = IntPtr.Zero; |
|
|
|
} |
|
|
|
|
|
|
|
_focusProxy.Cleanup(); |
|
|
|
_focusProxy?.Cleanup(); |
|
|
|
} |
|
|
|
|
|
|
|
private bool ActivateTransientChildIfNeeded() |
|
|
|
|