summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2022-12-21 15:09:11 +0100
committerFlorian Müllner <fmuellner@gnome.org>2023-02-13 19:07:58 +0100
commite6ab7432a7df39abc6a7cbb94555e97e7fe544a7 (patch)
treea5fb2213ce8eaa5127761da6cb412c99dbd2ac4d
parent22b9ac6d45775bbbb073e0d1b7b4802bcf0fb0be (diff)
downloadmutter-e6ab7432a7df39abc6a7cbb94555e97e7fe544a7.tar.gz
x11/events: Do not update focus XWindow during grabs
During grabs, it is expected that the X11 focus does not correspond to the display's focus window, as focus should be on the stage's XWindow instead. This still messes up the keyboard focus even after we stopped moving the X11 focus, because we end up with a presumed X11 focus window of None, and as a result the stage is considered unfocused. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5932 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2776> (cherry picked from commit 0e6395d93284422848ca3a5ffb88d48fbce7d471)
-rw-r--r--src/x11/events.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/x11/events.c b/src/x11/events.c
index 2c574d575..01002dcd9 100644
--- a/src/x11/events.c
+++ b/src/x11/events.c
@@ -1009,6 +1009,9 @@ handle_input_xevent (MetaX11Display *x11_display,
break;
case XI_FocusIn:
case XI_FocusOut:
+ if (clutter_stage_get_grab_actor (stage) != NULL)
+ break;
+
if (handle_window_focus_event (x11_display, window, enter_event, serial) &&
enter_event->event == enter_event->root)
{
@@ -1919,7 +1922,8 @@ meta_x11_display_handle_xevent (MetaX11Display *x11_display,
if (x11_display->focused_by_us &&
event->xany.serial > x11_display->focus_serial &&
display->focus_window &&
- !window_has_xwindow (display->focus_window, x11_display->server_focus_window))
+ !window_has_xwindow (display->focus_window, x11_display->server_focus_window) &&
+ meta_display_windows_are_interactable (display))
{
meta_topic (META_DEBUG_FOCUS, "Earlier attempt to focus %s failed",
display->focus_window->desc);