Backport MRs #2366 and #2321 to fix stuck modifiers and top bar hover

This commit is contained in:
Adam Williamson
2022-04-19 15:22:20 -07:00
parent 3418f0a3b7
commit 00e14a5559
4 changed files with 293 additions and 1 deletions

37
2366.patch Normal file
View File

@@ -0,0 +1,37 @@
From dd2eba8d12c2fca877e2180bbdcc5bce416781ae Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Wed, 6 Apr 2022 16:07:07 +0200
Subject: [PATCH] core: Account ClutterStage grabs on Wayland key focus
synchronization
When switching between the existence and not of a stage ClutterGrab, we
would correctly attempt to synchronize key focus from the perspective of
the Wayland clients.
But this synchronization should do its own checks about existing stage
grabs before determining a client window has key focus or not.
Add that check, so that grabs correctly unfocus the keyboard in Wayland
clients, in addition to pointers and touch.
Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2194
---
src/core/display.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/core/display.c b/src/core/display.c
index 5f99578a69..a1c5c2d912 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1431,6 +1431,8 @@ meta_display_sync_wayland_input_focus (MetaDisplay *display)
focus_window = NULL;
else if (is_no_focus_xwindow)
focus_window = NULL;
+ else if (clutter_stage_get_grab_actor (CLUTTER_STAGE (stage)))
+ focus_window = NULL;
else if (display->focus_window && display->focus_window->surface)
focus_window = display->focus_window;
else
--
GitLab