summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2022-12-09 18:40:47 +0100
committerRobert Mader <robert.mader@collabora.com>2023-01-06 13:53:08 +0100
commit762fcb6419a7f77cf3b7bd1103f0b350f874af15 (patch)
tree4b1c795904f3be0ff114f43ff6d722d54c04100c
parent931f2662a5d4382003d1b82c5fc9b44eafee80b1 (diff)
downloadmutter-762fcb6419a7f77cf3b7bd1103f0b350f874af15.tar.gz
core: Consider ClutterGrabs checking whether windows are interactive
There's 2 users of this, meta_display_sync_wayland_input_focus() which does already perform these checks on its own, and MetaCursorTracker's update_displayed_cursor() to determine whether it should go with the Wayland client's cursor. This second check should also consider the existing ClutterGrabs, so make meta_display_windows_are_interactable() handle them for both callers. Fixes the cursor shown over windows while e.g. there are menus opened. Close: https://gitlab.gnome.org/GNOME/mutter/-/issues/2553 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2754> (cherry picked from commit 02d4a07822de2fb0002186df62bb0c8127555085)
-rw-r--r--src/core/display.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/display.c b/src/core/display.c
index 0c897ab36..155606d63 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1278,6 +1278,12 @@ meta_grab_op_is_moving (MetaGrabOp op)
gboolean
meta_display_windows_are_interactable (MetaDisplay *display)
{
+ MetaBackend *backend = meta_get_backend ();
+ MetaStage *stage = META_STAGE (meta_backend_get_stage (backend));
+
+ if (clutter_stage_get_grab_actor (CLUTTER_STAGE (stage)))
+ return FALSE;
+
switch (display->event_route)
{
case META_EVENT_ROUTE_NORMAL:
@@ -1438,8 +1444,6 @@ 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