1
0
Fork 0

wayland: Check focus surface to set a pointer cursor

The cursor was following the "current" surface (i.e. the logical
focus, unaffected by e.g. grabs), so MetaWaylandPointer was always
providing window cursors, just so the MetaCursorRenderer would maybe
discard them and show the compositor cursor instead. E.g. in the
presence of grabs.

This clear barrier between grabs being compositor business deserving
a compositor cursor, and non-grabs being client business turned a bit
blurrier in grabs-pt5 where "client" things like popups and DnD would
also involve grabs. The fixes in that regard in the branch went on
the lenient side, introducing situations where grabs do exist but we
are preferring client-side cursors anyways.

Fix this by making MetaWaylandPointer aware of grabs at the time of
updating the client-side cursor, by following the "focus" surface
(i.e. the effective focus, affected by grabs outside of MetaWaylandInput).
The focus surface and cursor will be updated on focus changes, also
induced by grab changes.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3460
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3736>
This commit is contained in:
Carlos Garnacho 2024-05-03 18:09:36 +02:00 committed by Marge Bot
parent a27181ff5a
commit b35129db61

View file

@ -1133,7 +1133,7 @@ meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer)
MetaBackend *backend = backend_from_pointer (pointer);
MetaCursorTracker *cursor_tracker = meta_backend_get_cursor_tracker (backend);
if (pointer->current)
if (pointer->focus_surface)
{
MetaCursorSprite *cursor_sprite = NULL;