wayland/pointer: Update cursor surface when current surface changes

The cursor surface is decided by the "current" surface; if that alone
changed (e.g. current surface was destroyed), we didn't update the
cursor, meaning it either got stuck, or got hidden if the client exited
completely.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3262>
This commit is contained in:
Jonas Ådahl 2023-09-13 14:00:44 +08:00 committed by Marge Bot
parent 838d8881d9
commit c7efb68ff1

View File

@ -620,6 +620,9 @@ static void
meta_wayland_pointer_set_current (MetaWaylandPointer *pointer, meta_wayland_pointer_set_current (MetaWaylandPointer *pointer,
MetaWaylandSurface *surface) MetaWaylandSurface *surface)
{ {
if (pointer->current == surface)
return;
if (pointer->current) if (pointer->current)
{ {
g_clear_signal_handler (&pointer->current_surface_destroyed_handler_id, g_clear_signal_handler (&pointer->current_surface_destroyed_handler_id,
@ -635,6 +638,8 @@ meta_wayland_pointer_set_current (MetaWaylandPointer *pointer,
G_CALLBACK (current_surface_destroyed), G_CALLBACK (current_surface_destroyed),
pointer); pointer);
} }
meta_wayland_pointer_update_cursor_surface (pointer);
} }
static void static void