data-device: make device inert when seat is destroyed

This commit is contained in:
emersion 2018-12-09 16:58:31 +01:00
parent 9d6cb85b2d
commit 3f82eb1853
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
2 changed files with 16 additions and 5 deletions

View file

@ -86,7 +86,12 @@ static void seat_client_handle_resource_destroy(
wl_resource_destroy(resource);
}
wl_resource_for_each_safe(resource, tmp, &client->data_devices) {
wl_resource_destroy(resource);
// Make the data device inert
wl_resource_set_user_data(resource, NULL);
struct wl_list *link = wl_resource_get_link(resource);
wl_list_remove(link);
wl_list_init(link);
}
wl_list_remove(&client->link);