From 22434f2df0ef59a7c83d8187db0d15451a5557b3 Mon Sep 17 00:00:00 2001 From: walterlv Date: Sun, 12 May 2024 07:27:47 +0800 Subject: [PATCH] X11Window should probably ignore X11 grab focus events (#15686) --- src/Avalonia.X11/X11Window.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Avalonia.X11/X11Window.cs b/src/Avalonia.X11/X11Window.cs index 85eda99418..41f3dd8387 100644 --- a/src/Avalonia.X11/X11Window.cs +++ b/src/Avalonia.X11/X11Window.cs @@ -453,11 +453,17 @@ namespace Avalonia.X11 { if (ActivateTransientChildIfNeeded()) return; + // See: https://github.com/fltk/fltk/issues/295 + if ((NotifyMode)ev.FocusChangeEvent.mode is not NotifyMode.NotifyNormal) + return; Activated?.Invoke(); _imeControl?.SetWindowActive(true); } else if (ev.type == XEventName.FocusOut) { + // See: https://github.com/fltk/fltk/issues/295 + if ((NotifyMode)ev.FocusChangeEvent.mode is not NotifyMode.NotifyNormal) + return; _imeControl?.SetWindowActive(false); Deactivated?.Invoke(); }