From ea11148a49f6ace84c60e64d20cd0e7d328646e9 Mon Sep 17 00:00:00 2001 From: Ryan Walklin Date: Fri, 12 Dec 2025 21:29:46 +1300 Subject: [PATCH] input/seat: call start/finish for xdg-toplevel-drag lifecycle --- sway/input/seat.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sway/input/seat.c b/sway/input/seat.c index 3c51089cd..9fb581687 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -522,6 +522,8 @@ static void drag_handle_destroy(struct wl_listener *listener, void *data) { drag->wlr_drag->data = NULL; wl_list_remove(&drag->destroy.link); if (drag->toplevel_drag != NULL) { + // Mark drag as ended so client can safely destroy xdg_toplevel_drag + wlr_xdg_toplevel_drag_v1_finish(drag->toplevel_drag); wl_list_remove(&drag->motion.link); // Clean up our surface tracking listener if active if (drag->toplevel_surface != NULL) { @@ -582,6 +584,7 @@ static void handle_start_drag(struct wl_listener *listener, void *data) { drag->toplevel_drag = wlr_xdg_toplevel_drag_v1_from_wlr_data_source( server.xdg_toplevel_drag_manager, wlr_drag->source); if (drag->toplevel_drag != NULL) { + wlr_xdg_toplevel_drag_v1_start(drag->toplevel_drag); drag->motion.notify = toplevel_drag_handle_motion; wl_signal_add(&wlr_drag->events.motion, &drag->motion); // Initialize surface tracking (will be set on first identification)