From 7531669b4ffe90fcddb54efd51d2f1edf4e77430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 20 Dec 2022 20:22:40 +0100 Subject: [PATCH] display: Do not move X11 input focus during grabs On X11, the stage itself is backed by an XWindow, and moving the input focus elsewhere will bypass any Clutter-level grabs. This effectively allows newly opened windows to steal the focus from gnome-shell itself, which is clearly undesirable. To prevent that, only move the X11 focus when no grab is in place, just like commit 50e89e376 did for the stage focus. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5932 Part-of: --- src/core/display.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/display.c b/src/core/display.c index a4b590432..bb43e1469 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -1553,7 +1553,9 @@ meta_display_set_input_focus (MetaDisplay *display, if (meta_display_timestamp_too_old (display, ×tamp)) return; - if (display->x11_display) + + if (display->x11_display && + meta_display_windows_are_interactable (display)) { meta_x11_display_set_input_focus (display->x11_display, window, focus_frame, timestamp);