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>
This commit is contained in:
Carlos Garnacho 2022-12-09 18:40:47 +01:00 committed by Marge Bot
parent f9085b9f58
commit 02d4a07822

View File

@ -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;
#ifdef HAVE_WAYLAND
else if (display->focus_window &&
meta_window_get_wayland_surface (display->focus_window))