mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-03-12 05:34:35 -04:00
Assert (almost all) signals have no attached listeners on destroy
This commit is contained in:
parent
b03b05d2b3
commit
8f56f7ca43
79 changed files with 518 additions and 9 deletions
|
|
@ -71,6 +71,8 @@ static void seat_handle_get_touch(struct wl_client *client,
|
|||
static void seat_client_destroy(struct wlr_seat_client *client) {
|
||||
wl_signal_emit_mutable(&client->events.destroy, client);
|
||||
|
||||
assert(wl_list_empty(&client->events.destroy.listener_list));
|
||||
|
||||
if (client == client->seat->pointer_state.focused_client) {
|
||||
client->seat->pointer_state.focused_client = NULL;
|
||||
}
|
||||
|
|
@ -151,6 +153,7 @@ static struct wlr_seat_client *seat_client_create(struct wlr_seat *wlr_seat,
|
|||
wl_list_init(&seat_client->keyboards);
|
||||
wl_list_init(&seat_client->touches);
|
||||
wl_list_init(&seat_client->data_devices);
|
||||
|
||||
wl_signal_init(&seat_client->events.destroy);
|
||||
|
||||
wl_list_insert(&wlr_seat->clients, &seat_client->link);
|
||||
|
|
@ -227,6 +230,31 @@ void wlr_seat_destroy(struct wlr_seat *seat) {
|
|||
|
||||
wl_signal_emit_mutable(&seat->events.destroy, seat);
|
||||
|
||||
assert(wl_list_empty(&seat->pointer_state.events.focus_change.listener_list));
|
||||
|
||||
assert(wl_list_empty(&seat->keyboard_state.events.focus_change.listener_list));
|
||||
|
||||
assert(wl_list_empty(&seat->events.request_start_drag.listener_list));
|
||||
assert(wl_list_empty(&seat->events.start_drag.listener_list));
|
||||
|
||||
assert(wl_list_empty(&seat->events.request_set_cursor.listener_list));
|
||||
|
||||
assert(wl_list_empty(&seat->events.request_set_selection.listener_list));
|
||||
assert(wl_list_empty(&seat->events.set_selection.listener_list));
|
||||
assert(wl_list_empty(&seat->events.request_set_primary_selection.listener_list));
|
||||
assert(wl_list_empty(&seat->events.set_primary_selection.listener_list));
|
||||
|
||||
assert(wl_list_empty(&seat->events.pointer_grab_begin.listener_list));
|
||||
assert(wl_list_empty(&seat->events.pointer_grab_end.listener_list));
|
||||
|
||||
assert(wl_list_empty(&seat->events.keyboard_grab_begin.listener_list));
|
||||
assert(wl_list_empty(&seat->events.keyboard_grab_end.listener_list));
|
||||
|
||||
assert(wl_list_empty(&seat->events.touch_grab_begin.listener_list));
|
||||
assert(wl_list_empty(&seat->events.touch_grab_end.listener_list));
|
||||
|
||||
assert(wl_list_empty(&seat->events.destroy.listener_list));
|
||||
|
||||
wl_list_remove(&seat->display_destroy.link);
|
||||
|
||||
wlr_data_source_destroy(seat->selection_source);
|
||||
|
|
|
|||
|
|
@ -107,6 +107,8 @@ static void touch_point_clear_focus(struct wlr_touch_point *point) {
|
|||
static void touch_point_destroy(struct wlr_touch_point *point) {
|
||||
wl_signal_emit_mutable(&point->events.destroy, point);
|
||||
|
||||
assert(wl_list_empty(&point->events.destroy.listener_list));
|
||||
|
||||
touch_point_clear_focus(point);
|
||||
wl_list_remove(&point->surface_destroy.link);
|
||||
wl_list_remove(&point->client_destroy.link);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue