aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-12-12 11:00:28 +0100
committeremersion <contact@emersion.fr>2018-12-30 02:48:03 +0100
commitae1dd635b133dbe0e22c3b1b8ed93be0347e0865 (patch)
tree7fd3bf1947bf2e33fb8f3af906ec4d1f56ef300f
parentaa2dafb7c8b3c7ee6ef9ab49a0cc576c68f2768c (diff)
data-device: fix dangling listener in seat_client_selection_source_destroy
-rw-r--r--types/data_device/wlr_data_device.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/types/data_device/wlr_data_device.c b/types/data_device/wlr_data_device.c
index f868ea37..cda755b1 100644
--- a/types/data_device/wlr_data_device.c
+++ b/types/data_device/wlr_data_device.c
@@ -122,6 +122,9 @@ static void seat_client_selection_source_destroy(
wl_container_of(listener, seat, selection_source_destroy);
struct wlr_seat_client *seat_client = seat->keyboard_state.focused_client;
+ wl_list_remove(&seat->selection_source_destroy.link);
+ seat->selection_source = NULL;
+
if (seat_client && seat->keyboard_state.focused_surface) {
struct wl_resource *resource;
wl_resource_for_each(resource, &seat_client->data_devices) {
@@ -129,8 +132,6 @@ static void seat_client_selection_source_destroy(
}
}
- seat->selection_source = NULL;
-
wlr_signal_emit_safe(&seat->events.selection, seat);
}