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:50:41 +0100
commit6975a6684dfb2acd91332540d6e51238342827fa (patch)
tree7c5d63d4b1baf7e50df84eaa278db697fa063b9e
parent099cd549a9356fd04f86605edb9ae47bf520e6c1 (diff)
downloadmutter-6975a6684dfb2acd91332540d6e51238342827fa.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 353a4fb34..470ff804b 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1277,6 +1277,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:
@@ -1437,8 +1443,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