From 75aea9d1db81c5f52e740fad74885491ab7c1023 Mon Sep 17 00:00:00 2001 From: Ilya Pospelov Date: Tue, 5 Mar 2024 05:27:45 +0300 Subject: [PATCH] Backport fix NullReferenceException in X11Window.Activate (#14787) --- src/Avalonia.X11/X11Window.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Avalonia.X11/X11Window.cs b/src/Avalonia.X11/X11Window.cs index 95900f72a04..8e9c92864c7 100644 --- a/src/Avalonia.X11/X11Window.cs +++ b/src/Avalonia.X11/X11Window.cs @@ -1103,7 +1103,9 @@ public void Activate() else { XRaiseWindow(_x11.Display, _handle); - XSetInputFocus(_x11.Display, _focusProxy._handle, 0, IntPtr.Zero); + + if (_focusProxy is not null) + XSetInputFocus(_x11.Display, _focusProxy._handle, 0, IntPtr.Zero); } }