From e994fbf02ce8873985634b0b19778d1d39d4ebb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 3 Sep 2024 22:46:28 +0200 Subject: [PATCH] wayland/pointer-constraints: Warp pointer before destroying resource We're retrieving the context from the constraint instance, and the wl_resource_destroy() call indirectly destroys the instance, so warp earlier to still have a valid instance while warping. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3649 Fixes: 6a694d64f4 ("wayland/seat: Keep a back pointer to the ClutterSeat") Part-of: --- src/wayland/meta-wayland-pointer-constraints.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wayland/meta-wayland-pointer-constraints.c b/src/wayland/meta-wayland-pointer-constraints.c index 8dd3154b4..2c2e41246 100644 --- a/src/wayland/meta-wayland-pointer-constraints.c +++ b/src/wayland/meta-wayland-pointer-constraints.c @@ -958,10 +958,11 @@ locked_pointer_destroy (struct wl_client *client, warp_x = (int) x; warp_y = (int) y; } - wl_resource_destroy (resource); if (warp_pointer) clutter_seat_warp_pointer (constraint->seat->clutter_seat, warp_x, warp_y); + + wl_resource_destroy (resource); } static void