Skip to content

wayland: Check focus surface to set a pointer cursor

Carlos Garnacho requested to merge carlosg/mutter:wip/cursor-honors-focus into main

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: #3460

Merge request reports