aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-10-16 09:14:16 -0400
committerTony Crisci <tony@dubstepdish.com>2017-10-16 09:14:16 -0400
commitf9d578700e6f28d2d4dc1db3c81469640484473e (patch)
treeacf5df1111d3fcfdb0bc512b5201ef828a08bdaa
parentc0e8585a4cd3ef5b9616efa2f61fe5b029c5d147 (diff)
bug: fix seat handle destroy handler
-rw-r--r--types/wlr_data_device.c1
-rw-r--r--types/wlr_seat.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/types/wlr_data_device.c b/types/wlr_data_device.c
index 3fcd5873..8902c894 100644
--- a/types/wlr_data_device.c
+++ b/types/wlr_data_device.c
@@ -353,6 +353,7 @@ static void drag_handle_seat_unbound(struct wl_listener *listener, void *data) {
if (drag->focus_handle == unbound_handle) {
drag->focus_handle = NULL;
+ wl_list_remove(&drag->handle_unbound.link);
}
}
diff --git a/types/wlr_seat.c b/types/wlr_seat.c
index a4721e22..60db8d2e 100644
--- a/types/wlr_seat.c
+++ b/types/wlr_seat.c
@@ -142,6 +142,8 @@ static void wl_seat_get_touch(struct wl_client *client,
static void wlr_seat_handle_resource_destroy(struct wl_resource *resource) {
struct wlr_seat_handle *handle = wl_resource_get_user_data(resource);
+ wl_signal_emit(&handle->wlr_seat->events.client_unbound, handle);
+
if (handle == handle->wlr_seat->pointer_state.focused_handle) {
handle->wlr_seat->pointer_state.focused_handle = NULL;
}
@@ -161,7 +163,6 @@ static void wlr_seat_handle_resource_destroy(struct wl_resource *resource) {
if (handle->data_device) {
wl_resource_destroy(handle->data_device);
}
- wl_signal_emit(&handle->wlr_seat->events.client_unbound, handle);
wl_list_remove(&handle->link);
free(handle);
}