Assert (almost all) signals have no attached listeners on destroy

This commit is contained in:
Kirill Primak 2024-11-22 20:32:32 +03:00
parent b03b05d2b3
commit 8f56f7ca43
79 changed files with 518 additions and 9 deletions

View file

@ -48,6 +48,10 @@ void wlr_backend_init(struct wlr_backend *backend,
void wlr_backend_finish(struct wlr_backend *backend) { void wlr_backend_finish(struct wlr_backend *backend) {
wl_signal_emit_mutable(&backend->events.destroy, backend); wl_signal_emit_mutable(&backend->events.destroy, backend);
assert(wl_list_empty(&backend->events.destroy.listener_list));
assert(wl_list_empty(&backend->events.new_input.listener_list));
assert(wl_list_empty(&backend->events.new_output.listener_list));
} }
bool wlr_backend_start(struct wlr_backend *backend) { bool wlr_backend_start(struct wlr_backend *backend) {

View file

@ -2177,6 +2177,8 @@ void drm_lease_destroy(struct wlr_drm_lease *lease) {
wl_signal_emit_mutable(&lease->events.destroy, NULL); wl_signal_emit_mutable(&lease->events.destroy, NULL);
assert(wl_list_empty(&lease->events.destroy.listener_list));
struct wlr_drm_connector *conn; struct wlr_drm_connector *conn;
wl_list_for_each(conn, &drm->connectors, link) { wl_list_for_each(conn, &drm->connectors, link) {
if (conn->lease == lease) { if (conn->lease == lease) {

View file

@ -51,6 +51,9 @@ static void multi_backend_destroy(struct wlr_backend *wlr_backend) {
wlr_backend_finish(wlr_backend); wlr_backend_finish(wlr_backend);
assert(wl_list_empty(&backend->events.backend_add.listener_list));
assert(wl_list_empty(&backend->events.backend_remove.listener_list));
// Some backends may depend on other backends, ie. destroying a backend may // Some backends may depend on other backends, ie. destroying a backend may
// also destroy other backends // also destroy other backends
while (!wl_list_empty(&backend->backends)) { while (!wl_list_empty(&backend->backends)) {

View file

@ -303,6 +303,11 @@ void wlr_session_destroy(struct wlr_session *session) {
} }
wl_signal_emit_mutable(&session->events.destroy, session); wl_signal_emit_mutable(&session->events.destroy, session);
assert(wl_list_empty(&session->events.active.listener_list));
assert(wl_list_empty(&session->events.add_drm_card.listener_list));
assert(wl_list_empty(&session->events.destroy.listener_list));
wl_list_remove(&session->event_loop_destroy.link); wl_list_remove(&session->event_loop_destroy.link);
wl_event_source_remove(session->udev_event); wl_event_source_remove(session->udev_event);
@ -360,6 +365,10 @@ void wlr_session_close_file(struct wlr_session *session,
if (libseat_close_device(session->seat_handle, dev->device_id) == -1) { if (libseat_close_device(session->seat_handle, dev->device_id) == -1) {
wlr_log_errno(WLR_ERROR, "Failed to close device %d", dev->device_id); wlr_log_errno(WLR_ERROR, "Failed to close device %d", dev->device_id);
} }
assert(wl_list_empty(&dev->events.change.listener_list));
assert(wl_list_empty(&dev->events.remove.listener_list));
close(dev->fd); close(dev->fd);
wl_list_remove(&dev->link); wl_list_remove(&dev->link);
free(dev); free(dev);

View file

@ -28,6 +28,7 @@ void wlr_allocator_init(struct wlr_allocator *alloc,
.impl = impl, .impl = impl,
.buffer_caps = buffer_caps, .buffer_caps = buffer_caps,
}; };
wl_signal_init(&alloc->events.destroy); wl_signal_init(&alloc->events.destroy);
} }
@ -173,6 +174,9 @@ void wlr_allocator_destroy(struct wlr_allocator *alloc) {
return; return;
} }
wl_signal_emit_mutable(&alloc->events.destroy, NULL); wl_signal_emit_mutable(&alloc->events.destroy, NULL);
assert(wl_list_empty(&alloc->events.destroy.listener_list));
alloc->impl->destroy(alloc); alloc->impl->destroy(alloc);
} }

View file

@ -241,7 +241,8 @@ bool wlr_drm_syncobj_timeline_waiter_init(struct wlr_drm_syncobj_timeline_waiter
} }
void wlr_drm_syncobj_timeline_waiter_finish(struct wlr_drm_syncobj_timeline_waiter *waiter) { void wlr_drm_syncobj_timeline_waiter_finish(struct wlr_drm_syncobj_timeline_waiter *waiter) {
wl_list_remove(&waiter->events.ready.listener_list); assert(wl_list_empty(&waiter->events.ready.listener_list));
wl_event_source_remove(waiter->event_source); wl_event_source_remove(waiter->event_source);
close(waiter->ev_fd); close(waiter->ev_fd);
} }

View file

@ -51,6 +51,9 @@ void wlr_renderer_destroy(struct wlr_renderer *r) {
wl_signal_emit_mutable(&r->events.destroy, r); wl_signal_emit_mutable(&r->events.destroy, r);
assert(wl_list_empty(&r->events.destroy.listener_list));
assert(wl_list_empty(&r->events.lost.listener_list));
if (r->impl && r->impl->destroy) { if (r->impl && r->impl->destroy) {
r->impl->destroy(r); r->impl->destroy(r);
} else { } else {

View file

@ -1053,9 +1053,26 @@ int main(int argc, char *argv[]) {
socket); socket);
wl_display_run(server.wl_display); wl_display_run(server.wl_display);
/* Once wl_display_run returns, we destroy all clients then shut down the /* Once wl_display_run returns, we destroy all clients then shut down the
* server. */ * server. */
wl_display_destroy_clients(server.wl_display); wl_display_destroy_clients(server.wl_display);
wl_list_remove(&server.new_xdg_toplevel.link);
wl_list_remove(&server.new_xdg_popup.link);
wl_list_remove(&server.cursor_motion.link);
wl_list_remove(&server.cursor_motion_absolute.link);
wl_list_remove(&server.cursor_button.link);
wl_list_remove(&server.cursor_axis.link);
wl_list_remove(&server.cursor_frame.link);
wl_list_remove(&server.new_input.link);
wl_list_remove(&server.request_cursor.link);
wl_list_remove(&server.request_set_selection.link);
wl_list_remove(&server.new_output.link);
wlr_scene_node_destroy(&server.scene->tree.node); wlr_scene_node_destroy(&server.scene->tree.node);
wlr_xcursor_manager_destroy(server.cursor_mgr); wlr_xcursor_manager_destroy(server.cursor_mgr);
wlr_cursor_destroy(server.cursor); wlr_cursor_destroy(server.cursor);

View file

@ -17,14 +17,19 @@ void wlr_buffer_init(struct wlr_buffer *buffer,
.width = width, .width = width,
.height = height, .height = height,
}; };
wl_signal_init(&buffer->events.destroy); wl_signal_init(&buffer->events.destroy);
wl_signal_init(&buffer->events.release); wl_signal_init(&buffer->events.release);
wlr_addon_set_init(&buffer->addons); wlr_addon_set_init(&buffer->addons);
} }
void wlr_buffer_finish(struct wlr_buffer *buffer) { void wlr_buffer_finish(struct wlr_buffer *buffer) {
wl_signal_emit_mutable(&buffer->events.destroy, NULL); wl_signal_emit_mutable(&buffer->events.destroy, NULL);
wlr_addon_set_finish(&buffer->addons); wlr_addon_set_finish(&buffer->addons);
assert(wl_list_empty(&buffer->events.destroy.listener_list));
assert(wl_list_empty(&buffer->events.release.listener_list));
} }
static void buffer_consider_destroy(struct wlr_buffer *buffer) { static void buffer_consider_destroy(struct wlr_buffer *buffer) {

View file

@ -284,6 +284,9 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_data_device_manager *manager = struct wlr_data_device_manager *manager =
wl_container_of(listener, manager, display_destroy); wl_container_of(listener, manager, display_destroy);
wl_signal_emit_mutable(&manager->events.destroy, manager); wl_signal_emit_mutable(&manager->events.destroy, manager);
assert(wl_list_empty(&manager->events.destroy.listener_list));
wl_list_remove(&manager->display_destroy.link); wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global); wl_global_destroy(manager->global);
free(manager); free(manager);

View file

@ -41,6 +41,8 @@ void wlr_data_source_destroy(struct wlr_data_source *source) {
wl_signal_emit_mutable(&source->events.destroy, source); wl_signal_emit_mutable(&source->events.destroy, source);
assert(wl_list_empty(&source->events.destroy.listener_list));
char **p; char **p;
wl_array_for_each(p, &source->mime_types) { wl_array_for_each(p, &source->mime_types) {
free(*p); free(*p);

View file

@ -123,6 +123,9 @@ static void drag_icon_destroy(struct wlr_drag_icon *icon) {
icon->drag->icon = NULL; icon->drag->icon = NULL;
wl_list_remove(&icon->surface_destroy.link); wl_list_remove(&icon->surface_destroy.link);
wl_signal_emit_mutable(&icon->events.destroy, icon); wl_signal_emit_mutable(&icon->events.destroy, icon);
assert(wl_list_empty(&icon->events.destroy.listener_list));
free(icon); free(icon);
} }
@ -160,6 +163,11 @@ static void drag_destroy(struct wlr_drag *drag) {
// signal handler. // signal handler.
wl_signal_emit_mutable(&drag->events.destroy, drag); wl_signal_emit_mutable(&drag->events.destroy, drag);
assert(wl_list_empty(&drag->events.focus.listener_list));
assert(wl_list_empty(&drag->events.motion.listener_list));
assert(wl_list_empty(&drag->events.drop.listener_list));
assert(wl_list_empty(&drag->events.destroy.listener_list));
if (drag->source) { if (drag->source) {
wl_list_remove(&drag->source_destroy.link); wl_list_remove(&drag->source_destroy.link);
} }

View file

@ -149,4 +149,5 @@ void wlr_ext_image_capture_source_v1_cursor_init(struct wlr_ext_image_capture_so
void wlr_ext_image_capture_source_v1_cursor_finish(struct wlr_ext_image_capture_source_v1_cursor *source_cursor) { void wlr_ext_image_capture_source_v1_cursor_finish(struct wlr_ext_image_capture_source_v1_cursor *source_cursor) {
wlr_ext_image_capture_source_v1_finish(&source_cursor->base); wlr_ext_image_capture_source_v1_finish(&source_cursor->base);
assert(wl_list_empty(&source_cursor->events.update.listener_list));
} }

View file

@ -349,6 +349,7 @@ void wlr_output_init(struct wlr_output *output, struct wlr_backend *backend,
wl_list_init(&output->cursors); wl_list_init(&output->cursors);
wl_list_init(&output->layers); wl_list_init(&output->layers);
wl_list_init(&output->resources); wl_list_init(&output->resources);
wl_signal_init(&output->events.frame); wl_signal_init(&output->events.frame);
wl_signal_init(&output->events.damage); wl_signal_init(&output->events.damage);
wl_signal_init(&output->events.needs_frame); wl_signal_init(&output->events.needs_frame);
@ -377,13 +378,23 @@ void wlr_output_init(struct wlr_output *output, struct wlr_backend *backend,
void wlr_output_finish(struct wlr_output *output) { void wlr_output_finish(struct wlr_output *output) {
wl_signal_emit_mutable(&output->events.destroy, output); wl_signal_emit_mutable(&output->events.destroy, output);
wlr_addon_set_finish(&output->addons);
assert(wl_list_empty(&output->events.frame.listener_list));
assert(wl_list_empty(&output->events.damage.listener_list));
assert(wl_list_empty(&output->events.needs_frame.listener_list));
assert(wl_list_empty(&output->events.precommit.listener_list));
assert(wl_list_empty(&output->events.commit.listener_list));
assert(wl_list_empty(&output->events.present.listener_list));
assert(wl_list_empty(&output->events.bind.listener_list));
assert(wl_list_empty(&output->events.description.listener_list));
assert(wl_list_empty(&output->events.request_state.listener_list));
assert(wl_list_empty(&output->events.destroy.listener_list));
wlr_output_destroy_global(output); wlr_output_destroy_global(output);
wl_list_remove(&output->display_destroy.link); wl_list_remove(&output->display_destroy.link);
wlr_addon_set_finish(&output->addons);
// The backend is responsible for free-ing the list of modes // The backend is responsible for free-ing the list of modes
struct wlr_output_cursor *cursor, *tmp_cursor; struct wlr_output_cursor *cursor, *tmp_cursor;

View file

@ -833,6 +833,7 @@ struct wlr_scene_buffer *wlr_scene_buffer_create(struct wlr_scene_tree *parent,
wl_signal_init(&scene_buffer->events.output_leave); wl_signal_init(&scene_buffer->events.output_leave);
wl_signal_init(&scene_buffer->events.output_sample); wl_signal_init(&scene_buffer->events.output_sample);
wl_signal_init(&scene_buffer->events.frame_done); wl_signal_init(&scene_buffer->events.frame_done);
pixman_region32_init(&scene_buffer->opaque_region); pixman_region32_init(&scene_buffer->opaque_region);
wl_list_init(&scene_buffer->buffer_release.link); wl_list_init(&scene_buffer->buffer_release.link);
wl_list_init(&scene_buffer->renderer_destroy.link); wl_list_init(&scene_buffer->renderer_destroy.link);

View file

@ -71,6 +71,8 @@ static void seat_handle_get_touch(struct wl_client *client,
static void seat_client_destroy(struct wlr_seat_client *client) { static void seat_client_destroy(struct wlr_seat_client *client) {
wl_signal_emit_mutable(&client->events.destroy, 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) { if (client == client->seat->pointer_state.focused_client) {
client->seat->pointer_state.focused_client = NULL; 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->keyboards);
wl_list_init(&seat_client->touches); wl_list_init(&seat_client->touches);
wl_list_init(&seat_client->data_devices); wl_list_init(&seat_client->data_devices);
wl_signal_init(&seat_client->events.destroy); wl_signal_init(&seat_client->events.destroy);
wl_list_insert(&wlr_seat->clients, &seat_client->link); 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); 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); wl_list_remove(&seat->display_destroy.link);
wlr_data_source_destroy(seat->selection_source); wlr_data_source_destroy(seat->selection_source);

View file

@ -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) { static void touch_point_destroy(struct wlr_touch_point *point) {
wl_signal_emit_mutable(&point->events.destroy, point); wl_signal_emit_mutable(&point->events.destroy, point);
assert(wl_list_empty(&point->events.destroy.listener_list));
touch_point_clear_focus(point); touch_point_clear_focus(point);
wl_list_remove(&point->surface_destroy.link); wl_list_remove(&point->surface_destroy.link);
wl_list_remove(&point->client_destroy.link); wl_list_remove(&point->client_destroy.link);

View file

@ -270,6 +270,9 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_tablet_manager_v2 *manager = struct wlr_tablet_manager_v2 *manager =
wl_container_of(listener, manager, display_destroy); wl_container_of(listener, manager, display_destroy);
wl_signal_emit_mutable(&manager->events.destroy, manager); wl_signal_emit_mutable(&manager->events.destroy, manager);
assert(wl_list_empty(&manager->events.destroy.listener_list));
wl_list_remove(&manager->display_destroy.link); wl_list_remove(&manager->display_destroy.link);
struct wlr_tablet_seat_v2 *seat, *tmp; struct wlr_tablet_seat_v2 *seat, *tmp;
@ -296,6 +299,7 @@ struct wlr_tablet_manager_v2 *wlr_tablet_v2_create(struct wl_display *display) {
} }
wl_signal_init(&tablet->events.destroy); wl_signal_init(&tablet->events.destroy);
wl_list_init(&tablet->clients); wl_list_init(&tablet->clients);
wl_list_init(&tablet->seats); wl_list_init(&tablet->seats);

View file

@ -727,8 +727,15 @@ static void surface_handle_resource_destroy(struct wl_resource *resource) {
surface_destroy_role_object(surface); surface_destroy_role_object(surface);
wl_signal_emit_mutable(&surface->events.destroy, surface); wl_signal_emit_mutable(&surface->events.destroy, surface);
wlr_addon_set_finish(&surface->addons); wlr_addon_set_finish(&surface->addons);
assert(wl_list_empty(&surface->events.client_commit.listener_list));
assert(wl_list_empty(&surface->events.commit.listener_list));
assert(wl_list_empty(&surface->events.map.listener_list));
assert(wl_list_empty(&surface->events.unmap.listener_list));
assert(wl_list_empty(&surface->events.destroy.listener_list));
assert(wl_list_empty(&surface->events.new_subsurface.listener_list));
assert(wl_list_empty(&surface->synced)); assert(wl_list_empty(&surface->synced));
struct wlr_surface_state *cached, *cached_tmp; struct wlr_surface_state *cached, *cached_tmp;
@ -782,6 +789,7 @@ static struct wlr_surface *surface_create(struct wl_client *client,
wl_signal_init(&surface->events.unmap); wl_signal_init(&surface->events.unmap);
wl_signal_init(&surface->events.destroy); wl_signal_init(&surface->events.destroy);
wl_signal_init(&surface->events.new_subsurface); wl_signal_init(&surface->events.new_subsurface);
wl_list_init(&surface->current_outputs); wl_list_init(&surface->current_outputs);
wl_list_init(&surface->cached); wl_list_init(&surface->cached);
pixman_region32_init(&surface->buffer_damage); pixman_region32_init(&surface->buffer_damage);
@ -1337,6 +1345,10 @@ static void compositor_handle_display_destroy(
struct wlr_compositor *compositor = struct wlr_compositor *compositor =
wl_container_of(listener, compositor, display_destroy); wl_container_of(listener, compositor, display_destroy);
wl_signal_emit_mutable(&compositor->events.destroy, NULL); wl_signal_emit_mutable(&compositor->events.destroy, NULL);
assert(wl_list_empty(&compositor->events.new_surface.listener_list));
assert(wl_list_empty(&compositor->events.destroy.listener_list));
wl_list_remove(&compositor->display_destroy.link); wl_list_remove(&compositor->display_destroy.link);
wl_list_remove(&compositor->renderer_destroy.link); wl_list_remove(&compositor->renderer_destroy.link);
wl_global_destroy(compositor->global); wl_global_destroy(compositor->global);
@ -1368,6 +1380,7 @@ struct wlr_compositor *wlr_compositor_create(struct wl_display *display,
wl_signal_init(&compositor->events.new_surface); wl_signal_init(&compositor->events.new_surface);
wl_signal_init(&compositor->events.destroy); wl_signal_init(&compositor->events.destroy);
wl_list_init(&compositor->renderer_destroy.link); wl_list_init(&compositor->renderer_destroy.link);
compositor->display_destroy.notify = compositor_handle_display_destroy; compositor->display_destroy.notify = compositor_handle_display_destroy;

View file

@ -247,6 +247,34 @@ static void cursor_reset_image(struct wlr_cursor *cur) {
} }
void wlr_cursor_destroy(struct wlr_cursor *cur) { void wlr_cursor_destroy(struct wlr_cursor *cur) {
// pointer signals
assert(wl_list_empty(&cur->events.motion.listener_list));
assert(wl_list_empty(&cur->events.motion_absolute.listener_list));
assert(wl_list_empty(&cur->events.button.listener_list));
assert(wl_list_empty(&cur->events.axis.listener_list));
assert(wl_list_empty(&cur->events.frame.listener_list));
assert(wl_list_empty(&cur->events.swipe_begin.listener_list));
assert(wl_list_empty(&cur->events.swipe_update.listener_list));
assert(wl_list_empty(&cur->events.swipe_end.listener_list));
assert(wl_list_empty(&cur->events.pinch_begin.listener_list));
assert(wl_list_empty(&cur->events.pinch_update.listener_list));
assert(wl_list_empty(&cur->events.pinch_end.listener_list));
assert(wl_list_empty(&cur->events.hold_begin.listener_list));
assert(wl_list_empty(&cur->events.hold_end.listener_list));
// touch signals
assert(wl_list_empty(&cur->events.touch_up.listener_list));
assert(wl_list_empty(&cur->events.touch_down.listener_list));
assert(wl_list_empty(&cur->events.touch_motion.listener_list));
assert(wl_list_empty(&cur->events.touch_cancel.listener_list));
assert(wl_list_empty(&cur->events.touch_frame.listener_list));
// tablet tool signals
assert(wl_list_empty(&cur->events.tablet_tool_tip.listener_list));
assert(wl_list_empty(&cur->events.tablet_tool_axis.listener_list));
assert(wl_list_empty(&cur->events.tablet_tool_button.listener_list));
assert(wl_list_empty(&cur->events.tablet_tool_proximity.listener_list));
cursor_reset_image(cur); cursor_reset_image(cur);
cursor_detach_output_layout(cur); cursor_detach_output_layout(cur);

View file

@ -187,6 +187,8 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
wl_container_of(listener, manager, display_destroy); wl_container_of(listener, manager, display_destroy);
wl_signal_emit_mutable(&manager->events.destroy, NULL); wl_signal_emit_mutable(&manager->events.destroy, NULL);
assert(wl_list_empty(&manager->events.request_set_shape.listener_list));
assert(wl_list_empty(&manager->events.destroy.listener_list)); assert(wl_list_empty(&manager->events.destroy.listener_list));
wl_global_destroy(manager->global); wl_global_destroy(manager->global);

View file

@ -666,6 +666,10 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_data_control_manager_v1 *manager = struct wlr_data_control_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy); wl_container_of(listener, manager, display_destroy);
wl_signal_emit_mutable(&manager->events.destroy, manager); wl_signal_emit_mutable(&manager->events.destroy, manager);
assert(wl_list_empty(&manager->events.destroy.listener_list));
assert(wl_list_empty(&manager->events.new_device.listener_list));
wl_list_remove(&manager->display_destroy.link); wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global); wl_global_destroy(manager->global);
free(manager); free(manager);
@ -678,6 +682,7 @@ struct wlr_data_control_manager_v1 *wlr_data_control_manager_v1_create(
return NULL; return NULL;
} }
wl_list_init(&manager->devices); wl_list_init(&manager->devices);
wl_signal_init(&manager->events.destroy); wl_signal_init(&manager->events.destroy);
wl_signal_init(&manager->events.new_device); wl_signal_init(&manager->events.new_device);

View file

@ -189,6 +189,8 @@ static const struct wlr_buffer_resource_interface buffer_resource_interface = {
static void drm_destroy(struct wlr_drm *drm) { static void drm_destroy(struct wlr_drm *drm) {
wl_signal_emit_mutable(&drm->events.destroy, NULL); wl_signal_emit_mutable(&drm->events.destroy, NULL);
assert(wl_list_empty(&drm->events.destroy.listener_list));
wl_list_remove(&drm->display_destroy.link); wl_list_remove(&drm->display_destroy.link);
wlr_drm_format_set_finish(&drm->formats); wlr_drm_format_set_finish(&drm->formats);

View file

@ -684,6 +684,9 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
wl_signal_emit_mutable(&manager->events.destroy, NULL); wl_signal_emit_mutable(&manager->events.destroy, NULL);
assert(wl_list_empty(&manager->events.destroy.listener_list));
assert(wl_list_empty(&manager->events.request.listener_list));
struct wlr_drm_lease_device_v1 *device, *tmp; struct wlr_drm_lease_device_v1 *device, *tmp;
wl_list_for_each_safe(device, tmp, &manager->devices, link) { wl_list_for_each_safe(device, tmp, &manager->devices, link) {
drm_lease_device_v1_destroy(device); drm_lease_device_v1_destroy(device);

View file

@ -192,6 +192,9 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_export_dmabuf_manager_v1 *manager = struct wlr_export_dmabuf_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy); wl_container_of(listener, manager, display_destroy);
wl_signal_emit_mutable(&manager->events.destroy, manager); wl_signal_emit_mutable(&manager->events.destroy, manager);
assert(wl_list_empty(&manager->events.destroy.listener_list));
wl_list_remove(&manager->display_destroy.link); wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global); wl_global_destroy(manager->global);
free(manager); free(manager);
@ -204,6 +207,7 @@ struct wlr_export_dmabuf_manager_v1 *wlr_export_dmabuf_manager_v1_create(
return NULL; return NULL;
} }
wl_list_init(&manager->frames); wl_list_init(&manager->frames);
wl_signal_init(&manager->events.destroy); wl_signal_init(&manager->events.destroy);
manager->global = wl_global_create(display, manager->global = wl_global_create(display,

View file

@ -91,6 +91,8 @@ void wlr_ext_foreign_toplevel_handle_v1_destroy(
wl_signal_emit_mutable(&toplevel->events.destroy, NULL); wl_signal_emit_mutable(&toplevel->events.destroy, NULL);
assert(wl_list_empty(&toplevel->events.destroy.listener_list));
struct wl_resource *resource, *tmp; struct wl_resource *resource, *tmp;
wl_resource_for_each_safe(resource, tmp, &toplevel->resources) { wl_resource_for_each_safe(resource, tmp, &toplevel->resources) {
ext_foreign_toplevel_handle_v1_send_closed(resource); ext_foreign_toplevel_handle_v1_send_closed(resource);
@ -253,6 +255,9 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_ext_foreign_toplevel_list_v1 *list = struct wlr_ext_foreign_toplevel_list_v1 *list =
wl_container_of(listener, list, display_destroy); wl_container_of(listener, list, display_destroy);
wl_signal_emit_mutable(&list->events.destroy, NULL); wl_signal_emit_mutable(&list->events.destroy, NULL);
assert(wl_list_empty(&list->events.destroy.listener_list));
wl_list_remove(&list->display_destroy.link); wl_list_remove(&list->display_destroy.link);
wl_global_destroy(list->global); wl_global_destroy(list->global);
free(list); free(list);
@ -277,6 +282,7 @@ struct wlr_ext_foreign_toplevel_list_v1 *wlr_ext_foreign_toplevel_list_v1_create
} }
wl_signal_init(&list->events.destroy); wl_signal_init(&list->events.destroy);
wl_list_init(&list->resources); wl_list_init(&list->resources);
wl_list_init(&list->toplevels); wl_list_init(&list->toplevels);

View file

@ -452,6 +452,14 @@ void wlr_foreign_toplevel_handle_v1_destroy(
wl_signal_emit_mutable(&toplevel->events.destroy, toplevel); wl_signal_emit_mutable(&toplevel->events.destroy, toplevel);
assert(wl_list_empty(&toplevel->events.request_maximize.listener_list));
assert(wl_list_empty(&toplevel->events.request_minimize.listener_list));
assert(wl_list_empty(&toplevel->events.request_activate.listener_list));
assert(wl_list_empty(&toplevel->events.request_fullscreen.listener_list));
assert(wl_list_empty(&toplevel->events.request_close.listener_list));
assert(wl_list_empty(&toplevel->events.set_rectangle.listener_list));
assert(wl_list_empty(&toplevel->events.destroy.listener_list));
struct wl_resource *resource, *tmp; struct wl_resource *resource, *tmp;
wl_resource_for_each_safe(resource, tmp, &toplevel->resources) { wl_resource_for_each_safe(resource, tmp, &toplevel->resources) {
zwlr_foreign_toplevel_handle_v1_send_closed(resource); zwlr_foreign_toplevel_handle_v1_send_closed(resource);
@ -627,6 +635,9 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_foreign_toplevel_manager_v1 *manager = struct wlr_foreign_toplevel_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy); wl_container_of(listener, manager, display_destroy);
wl_signal_emit_mutable(&manager->events.destroy, manager); wl_signal_emit_mutable(&manager->events.destroy, manager);
assert(wl_list_empty(&manager->events.destroy.listener_list));
wl_list_remove(&manager->display_destroy.link); wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global); wl_global_destroy(manager->global);
free(manager); free(manager);
@ -650,6 +661,7 @@ struct wlr_foreign_toplevel_manager_v1 *wlr_foreign_toplevel_manager_v1_create(
} }
wl_signal_init(&manager->events.destroy); wl_signal_init(&manager->events.destroy);
wl_list_init(&manager->resources); wl_list_init(&manager->resources);
wl_list_init(&manager->toplevels); wl_list_init(&manager->toplevels);

View file

@ -109,6 +109,10 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_fullscreen_shell_v1 *shell = struct wlr_fullscreen_shell_v1 *shell =
wl_container_of(listener, shell, display_destroy); wl_container_of(listener, shell, display_destroy);
wl_signal_emit_mutable(&shell->events.destroy, shell); wl_signal_emit_mutable(&shell->events.destroy, shell);
assert(wl_list_empty(&shell->events.destroy.listener_list));
assert(wl_list_empty(&shell->events.present_surface.listener_list));
wl_list_remove(&shell->display_destroy.link); wl_list_remove(&shell->display_destroy.link);
wl_global_destroy(shell->global); wl_global_destroy(shell->global);
free(shell); free(shell);

View file

@ -215,6 +215,10 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_gamma_control_manager_v1 *manager = struct wlr_gamma_control_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy); wl_container_of(listener, manager, display_destroy);
wl_signal_emit_mutable(&manager->events.destroy, manager); wl_signal_emit_mutable(&manager->events.destroy, manager);
assert(wl_list_empty(&manager->events.destroy.listener_list));
assert(wl_list_empty(&manager->events.set_gamma.listener_list));
wl_list_remove(&manager->display_destroy.link); wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global); wl_global_destroy(manager->global);
free(manager); free(manager);
@ -237,6 +241,7 @@ struct wlr_gamma_control_manager_v1 *wlr_gamma_control_manager_v1_create(
wl_signal_init(&manager->events.destroy); wl_signal_init(&manager->events.destroy);
wl_signal_init(&manager->events.set_gamma); wl_signal_init(&manager->events.set_gamma);
wl_list_init(&manager->controls); wl_list_init(&manager->controls);
manager->display_destroy.notify = handle_display_destroy; manager->display_destroy.notify = handle_display_destroy;

View file

@ -34,6 +34,8 @@ static void idle_inhibitor_v1_destroy(struct wlr_idle_inhibitor_v1 *inhibitor) {
wl_signal_emit_mutable(&inhibitor->events.destroy, inhibitor->surface); wl_signal_emit_mutable(&inhibitor->events.destroy, inhibitor->surface);
assert(wl_list_empty(&inhibitor->events.destroy.listener_list));
wl_resource_set_user_data(inhibitor->resource, NULL); wl_resource_set_user_data(inhibitor->resource, NULL);
wl_list_remove(&inhibitor->link); wl_list_remove(&inhibitor->link);
wl_list_remove(&inhibitor->surface_destroy.link); wl_list_remove(&inhibitor->surface_destroy.link);
@ -87,6 +89,7 @@ static void manager_handle_create_inhibitor(struct wl_client *client,
inhibitor->resource = inhibitor_resource; inhibitor->resource = inhibitor_resource;
inhibitor->surface = surface; inhibitor->surface = surface;
wl_signal_init(&inhibitor->events.destroy); wl_signal_init(&inhibitor->events.destroy);
inhibitor->surface_destroy.notify = idle_inhibitor_handle_surface_destroy; inhibitor->surface_destroy.notify = idle_inhibitor_handle_surface_destroy;
@ -113,6 +116,10 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_idle_inhibit_manager_v1 *manager = struct wlr_idle_inhibit_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy); wl_container_of(listener, manager, display_destroy);
wl_signal_emit_mutable(&manager->events.destroy, manager); wl_signal_emit_mutable(&manager->events.destroy, manager);
assert(wl_list_empty(&manager->events.new_inhibitor.listener_list));
assert(wl_list_empty(&manager->events.destroy.listener_list));
wl_list_remove(&manager->display_destroy.link); wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global); wl_global_destroy(manager->global);
free(manager); free(manager);
@ -140,6 +147,7 @@ struct wlr_idle_inhibit_manager_v1 *wlr_idle_inhibit_v1_create(struct wl_display
} }
wl_list_init(&manager->inhibitors); wl_list_init(&manager->inhibitors);
wl_signal_init(&manager->events.new_inhibitor); wl_signal_init(&manager->events.new_inhibitor);
wl_signal_init(&manager->events.destroy); wl_signal_init(&manager->events.destroy);

View file

@ -1,4 +1,4 @@
#include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "interfaces/wlr_input_device.h" #include "interfaces/wlr_input_device.h"
@ -20,7 +20,7 @@ void wlr_input_device_finish(struct wlr_input_device *wlr_device) {
wl_signal_emit_mutable(&wlr_device->events.destroy, wlr_device); wl_signal_emit_mutable(&wlr_device->events.destroy, wlr_device);
wl_list_remove(&wlr_device->events.destroy.listener_list); assert(wl_list_empty(&wlr_device->events.destroy.listener_list));
free(wlr_device->name); free(wlr_device->name);
} }

View file

@ -27,6 +27,9 @@ static void popup_surface_destroy(struct wlr_input_popup_surface_v2 *popup_surfa
wlr_surface_unmap(popup_surface->surface); wlr_surface_unmap(popup_surface->surface);
wl_signal_emit_mutable(&popup_surface->events.destroy, NULL); wl_signal_emit_mutable(&popup_surface->events.destroy, NULL);
assert(wl_list_empty(&popup_surface->events.destroy.listener_list));
wl_list_remove(&popup_surface->link); wl_list_remove(&popup_surface->link);
wl_resource_set_user_data(popup_surface->resource, NULL); wl_resource_set_user_data(popup_surface->resource, NULL);
free(popup_surface); free(popup_surface);
@ -54,6 +57,12 @@ static void input_method_destroy(struct wlr_input_method_v2 *input_method) {
popup_surface_destroy(popup_surface); popup_surface_destroy(popup_surface);
} }
wl_signal_emit_mutable(&input_method->events.destroy, input_method); wl_signal_emit_mutable(&input_method->events.destroy, input_method);
assert(wl_list_empty(&input_method->events.commit.listener_list));
assert(wl_list_empty(&input_method->events.new_popup_surface.listener_list));
assert(wl_list_empty(&input_method->events.grab_keyboard.listener_list));
assert(wl_list_empty(&input_method->events.destroy.listener_list));
wl_list_remove(wl_resource_get_link(input_method->resource)); wl_list_remove(wl_resource_get_link(input_method->resource));
wl_list_remove(&input_method->seat_client_destroy.link); wl_list_remove(&input_method->seat_client_destroy.link);
wlr_input_method_keyboard_grab_v2_destroy(input_method->keyboard_grab); wlr_input_method_keyboard_grab_v2_destroy(input_method->keyboard_grab);
@ -263,6 +272,9 @@ void wlr_input_method_keyboard_grab_v2_destroy(
return; return;
} }
wl_signal_emit_mutable(&keyboard_grab->events.destroy, keyboard_grab); wl_signal_emit_mutable(&keyboard_grab->events.destroy, keyboard_grab);
assert(wl_list_empty(&keyboard_grab->events.destroy.listener_list));
keyboard_grab->input_method->keyboard_grab = NULL; keyboard_grab->input_method->keyboard_grab = NULL;
if (keyboard_grab->keyboard) { if (keyboard_grab->keyboard) {
wl_list_remove(&keyboard_grab->keyboard_keymap.link); wl_list_remove(&keyboard_grab->keyboard_keymap.link);
@ -433,7 +445,9 @@ static void im_grab_keyboard(struct wl_client *client,
keyboard_grab->resource = keyboard_grab_resource; keyboard_grab->resource = keyboard_grab_resource;
keyboard_grab->input_method = input_method; keyboard_grab->input_method = input_method;
input_method->keyboard_grab = keyboard_grab; input_method->keyboard_grab = keyboard_grab;
wl_signal_init(&keyboard_grab->events.destroy); wl_signal_init(&keyboard_grab->events.destroy);
wl_signal_emit_mutable(&input_method->events.grab_keyboard, keyboard_grab); wl_signal_emit_mutable(&input_method->events.grab_keyboard, keyboard_grab);
} }
@ -544,6 +558,7 @@ static void manager_get_input_method(struct wl_client *client,
return; return;
} }
wl_list_init(&input_method->popup_surfaces); wl_list_init(&input_method->popup_surfaces);
wl_signal_init(&input_method->events.commit); wl_signal_init(&input_method->events.commit);
wl_signal_init(&input_method->events.new_popup_surface); wl_signal_init(&input_method->events.new_popup_surface);
wl_signal_init(&input_method->events.grab_keyboard); wl_signal_init(&input_method->events.grab_keyboard);
@ -592,6 +607,10 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_input_method_manager_v2 *manager = struct wlr_input_method_manager_v2 *manager =
wl_container_of(listener, manager, display_destroy); wl_container_of(listener, manager, display_destroy);
wl_signal_emit_mutable(&manager->events.destroy, manager); wl_signal_emit_mutable(&manager->events.destroy, manager);
assert(wl_list_empty(&manager->events.input_method.listener_list));
assert(wl_list_empty(&manager->events.destroy.listener_list));
wl_list_remove(&manager->display_destroy.link); wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global); wl_global_destroy(manager->global);
free(manager); free(manager);
@ -603,8 +622,10 @@ struct wlr_input_method_manager_v2 *wlr_input_method_manager_v2_create(
if (!im_manager) { if (!im_manager) {
return NULL; return NULL;
} }
wl_signal_init(&im_manager->events.input_method); wl_signal_init(&im_manager->events.input_method);
wl_signal_init(&im_manager->events.destroy); wl_signal_init(&im_manager->events.destroy);
wl_list_init(&im_manager->input_methods); wl_list_init(&im_manager->input_methods);
im_manager->global = wl_global_create(display, im_manager->global = wl_global_create(display,

View file

@ -171,6 +171,11 @@ void wlr_keyboard_finish(struct wlr_keyboard *kb) {
wlr_input_device_finish(&kb->base); wlr_input_device_finish(&kb->base);
assert(wl_list_empty(&kb->events.key.listener_list));
assert(wl_list_empty(&kb->events.modifiers.listener_list));
assert(wl_list_empty(&kb->events.keymap.listener_list));
assert(wl_list_empty(&kb->events.repeat_info.listener_list));
keyboard_unset_keymap(kb); keyboard_unset_keymap(kb);
} }

View file

@ -311,7 +311,9 @@ void wlr_keyboard_group_destroy(struct wlr_keyboard_group *group) {
wlr_keyboard_group_remove_keyboard(group, device->keyboard); wlr_keyboard_group_remove_keyboard(group, device->keyboard);
} }
wlr_keyboard_finish(&group->keyboard); wlr_keyboard_finish(&group->keyboard);
wl_list_remove(&group->events.enter.listener_list);
wl_list_remove(&group->events.leave.listener_list); assert(wl_list_empty(&group->events.enter.listener_list));
assert(wl_list_empty(&group->events.leave.listener_list));
free(group); free(group);
} }

View file

@ -36,6 +36,8 @@ static void keyboard_shortcuts_inhibitor_v1_destroy(
wl_signal_emit_mutable(&inhibitor->events.destroy, inhibitor); wl_signal_emit_mutable(&inhibitor->events.destroy, inhibitor);
assert(wl_list_empty(&inhibitor->events.destroy.listener_list));
wl_resource_set_user_data(inhibitor->resource, NULL); wl_resource_set_user_data(inhibitor->resource, NULL);
wl_list_remove(&inhibitor->link); wl_list_remove(&inhibitor->link);
wl_list_remove(&inhibitor->surface_destroy.link); wl_list_remove(&inhibitor->surface_destroy.link);
@ -132,6 +134,7 @@ static void manager_handle_inhibit_shortcuts(struct wl_client *client,
inhibitor->surface = surface; inhibitor->surface = surface;
inhibitor->seat = seat; inhibitor->seat = seat;
inhibitor->active = false; inhibitor->active = false;
wl_signal_init(&inhibitor->events.destroy); wl_signal_init(&inhibitor->events.destroy);
inhibitor->surface_destroy.notify = inhibitor->surface_destroy.notify =
@ -162,6 +165,10 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_keyboard_shortcuts_inhibit_manager_v1 *manager = struct wlr_keyboard_shortcuts_inhibit_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy); wl_container_of(listener, manager, display_destroy);
wl_signal_emit_mutable(&manager->events.destroy, manager); wl_signal_emit_mutable(&manager->events.destroy, manager);
assert(wl_list_empty(&manager->events.new_inhibitor.listener_list));
assert(wl_list_empty(&manager->events.destroy.listener_list));
wl_list_remove(&manager->display_destroy.link); wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global); wl_global_destroy(manager->global);
free(manager); free(manager);
@ -191,6 +198,7 @@ wlr_keyboard_shortcuts_inhibit_v1_create(struct wl_display *display) {
} }
wl_list_init(&manager->inhibitors); wl_list_init(&manager->inhibitors);
wl_signal_init(&manager->events.new_inhibitor); wl_signal_init(&manager->events.new_inhibitor);
wl_signal_init(&manager->events.destroy); wl_signal_init(&manager->events.destroy);

View file

@ -50,6 +50,10 @@ static void layer_surface_destroy(struct wlr_layer_surface_v1 *surface) {
layer_surface_reset(surface); layer_surface_reset(surface);
wl_signal_emit_mutable(&surface->events.destroy, surface); wl_signal_emit_mutable(&surface->events.destroy, surface);
assert(wl_list_empty(&surface->events.destroy.listener_list));
assert(wl_list_empty(&surface->events.new_popup.listener_list));
wlr_surface_synced_finish(&surface->synced); wlr_surface_synced_finish(&surface->synced);
wl_resource_set_user_data(surface->resource, NULL); wl_resource_set_user_data(surface->resource, NULL);
free(surface->namespace); free(surface->namespace);
@ -541,6 +545,10 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_layer_shell_v1 *layer_shell = struct wlr_layer_shell_v1 *layer_shell =
wl_container_of(listener, layer_shell, display_destroy); wl_container_of(listener, layer_shell, display_destroy);
wl_signal_emit_mutable(&layer_shell->events.destroy, layer_shell); wl_signal_emit_mutable(&layer_shell->events.destroy, layer_shell);
assert(wl_list_empty(&layer_shell->events.new_surface.listener_list));
assert(wl_list_empty(&layer_shell->events.destroy.listener_list));
wl_list_remove(&layer_shell->display_destroy.link); wl_list_remove(&layer_shell->display_destroy.link);
wl_global_destroy(layer_shell->global); wl_global_destroy(layer_shell->global);
free(layer_shell); free(layer_shell);

View file

@ -859,6 +859,8 @@ static const struct wlr_buffer_resource_interface buffer_resource_interface = {
static void linux_dmabuf_v1_destroy(struct wlr_linux_dmabuf_v1 *linux_dmabuf) { static void linux_dmabuf_v1_destroy(struct wlr_linux_dmabuf_v1 *linux_dmabuf) {
wl_signal_emit_mutable(&linux_dmabuf->events.destroy, linux_dmabuf); wl_signal_emit_mutable(&linux_dmabuf->events.destroy, linux_dmabuf);
assert(wl_list_empty(&linux_dmabuf->events.destroy.listener_list));
struct wlr_linux_dmabuf_v1_surface *surface, *surface_tmp; struct wlr_linux_dmabuf_v1_surface *surface, *surface_tmp;
wl_list_for_each_safe(surface, surface_tmp, &linux_dmabuf->surfaces, link) { wl_list_for_each_safe(surface, surface_tmp, &linux_dmabuf->surfaces, link) {
surface_destroy(surface); surface_destroy(surface);
@ -958,6 +960,7 @@ struct wlr_linux_dmabuf_v1 *wlr_linux_dmabuf_v1_create(struct wl_display *displa
linux_dmabuf->main_device_fd = -1; linux_dmabuf->main_device_fd = -1;
wl_list_init(&linux_dmabuf->surfaces); wl_list_init(&linux_dmabuf->surfaces);
wl_signal_init(&linux_dmabuf->events.destroy); wl_signal_init(&linux_dmabuf->events.destroy);
linux_dmabuf->global = wl_global_create(display, &zwp_linux_dmabuf_v1_interface, linux_dmabuf->global = wl_global_create(display, &zwp_linux_dmabuf_v1_interface,

View file

@ -1,3 +1,4 @@
#include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <wlr/types/wlr_output_layer.h> #include <wlr/types/wlr_output_layer.h>
@ -9,6 +10,7 @@ struct wlr_output_layer *wlr_output_layer_create(struct wlr_output *output) {
wl_list_insert(&output->layers, &layer->link); wl_list_insert(&output->layers, &layer->link);
wlr_addon_set_init(&layer->addons); wlr_addon_set_init(&layer->addons);
wl_signal_init(&layer->events.feedback); wl_signal_init(&layer->events.feedback);
return layer; return layer;
@ -20,6 +22,9 @@ void wlr_output_layer_destroy(struct wlr_output_layer *layer) {
} }
wlr_addon_set_finish(&layer->addons); wlr_addon_set_finish(&layer->addons);
assert(wl_list_empty(&layer->events.feedback.listener_list));
wl_list_remove(&layer->link); wl_list_remove(&layer->link);
free(layer); free(layer);
} }

View file

@ -36,6 +36,9 @@ struct wlr_output_layout *wlr_output_layout_create(struct wl_display *display) {
static void output_layout_output_destroy( static void output_layout_output_destroy(
struct wlr_output_layout_output *l_output) { struct wlr_output_layout_output *l_output) {
wl_signal_emit_mutable(&l_output->events.destroy, l_output); wl_signal_emit_mutable(&l_output->events.destroy, l_output);
assert(wl_list_empty(&l_output->events.destroy.listener_list));
wlr_output_destroy_global(l_output->output); wlr_output_destroy_global(l_output->output);
wl_list_remove(&l_output->commit.link); wl_list_remove(&l_output->commit.link);
wl_list_remove(&l_output->link); wl_list_remove(&l_output->link);
@ -50,6 +53,10 @@ void wlr_output_layout_destroy(struct wlr_output_layout *layout) {
wl_signal_emit_mutable(&layout->events.destroy, layout); wl_signal_emit_mutable(&layout->events.destroy, layout);
assert(wl_list_empty(&layout->events.add.listener_list));
assert(wl_list_empty(&layout->events.change.listener_list));
assert(wl_list_empty(&layout->events.destroy.listener_list));
struct wlr_output_layout_output *l_output, *temp; struct wlr_output_layout_output *l_output, *temp;
wl_list_for_each_safe(l_output, temp, &layout->outputs, link) { wl_list_for_each_safe(l_output, temp, &layout->outputs, link) {
output_layout_output_destroy(l_output); output_layout_output_destroy(l_output);
@ -160,6 +167,7 @@ static struct wlr_output_layout_output *output_layout_output_create(
} }
l_output->layout = layout; l_output->layout = layout;
l_output->output = output; l_output->output = output;
wl_signal_init(&l_output->events.destroy); wl_signal_init(&l_output->events.destroy);
/* /*

View file

@ -647,6 +647,11 @@ static void manager_handle_display_destroy(struct wl_listener *listener,
struct wlr_output_manager_v1 *manager = struct wlr_output_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy); wl_container_of(listener, manager, display_destroy);
wl_signal_emit_mutable(&manager->events.destroy, manager); wl_signal_emit_mutable(&manager->events.destroy, manager);
assert(wl_list_empty(&manager->events.destroy.listener_list));
assert(wl_list_empty(&manager->events.apply.listener_list));
assert(wl_list_empty(&manager->events.test.listener_list));
wl_list_remove(&manager->display_destroy.link); wl_list_remove(&manager->display_destroy.link);
struct wlr_output_head_v1 *head, *tmp; struct wlr_output_head_v1 *head, *tmp;
wl_list_for_each_safe(head, tmp, &manager->heads, link) { wl_list_for_each_safe(head, tmp, &manager->heads, link) {
@ -666,6 +671,7 @@ struct wlr_output_manager_v1 *wlr_output_manager_v1_create(
wl_list_init(&manager->resources); wl_list_init(&manager->resources);
wl_list_init(&manager->heads); wl_list_init(&manager->heads);
wl_signal_init(&manager->events.destroy); wl_signal_init(&manager->events.destroy);
wl_signal_init(&manager->events.apply); wl_signal_init(&manager->events.apply);
wl_signal_init(&manager->events.test); wl_signal_init(&manager->events.test);

View file

@ -193,6 +193,10 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_output_power_manager_v1 *manager = struct wlr_output_power_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy); wl_container_of(listener, manager, display_destroy);
wl_signal_emit_mutable(&manager->events.destroy, manager); wl_signal_emit_mutable(&manager->events.destroy, manager);
assert(wl_list_empty(&manager->events.set_mode.listener_list));
assert(wl_list_empty(&manager->events.destroy.listener_list));
wl_global_destroy(manager->global); wl_global_destroy(manager->global);
free(manager); free(manager);
} }
@ -214,6 +218,7 @@ struct wlr_output_power_manager_v1 *wlr_output_power_manager_v1_create(
wl_signal_init(&manager->events.set_mode); wl_signal_init(&manager->events.set_mode);
wl_signal_init(&manager->events.destroy); wl_signal_init(&manager->events.destroy);
wl_list_init(&manager->output_powers); wl_list_init(&manager->output_powers);
manager->display_destroy.notify = handle_display_destroy; manager->display_destroy.notify = handle_display_destroy;

View file

@ -51,6 +51,20 @@ void wlr_pointer_finish(struct wlr_pointer *pointer) {
wlr_input_device_finish(&pointer->base); wlr_input_device_finish(&pointer->base);
assert(wl_list_empty(&pointer->events.motion.listener_list));
assert(wl_list_empty(&pointer->events.motion_absolute.listener_list));
assert(wl_list_empty(&pointer->events.button.listener_list));
assert(wl_list_empty(&pointer->events.axis.listener_list));
assert(wl_list_empty(&pointer->events.frame.listener_list));
assert(wl_list_empty(&pointer->events.swipe_begin.listener_list));
assert(wl_list_empty(&pointer->events.swipe_update.listener_list));
assert(wl_list_empty(&pointer->events.swipe_end.listener_list));
assert(wl_list_empty(&pointer->events.pinch_begin.listener_list));
assert(wl_list_empty(&pointer->events.pinch_update.listener_list));
assert(wl_list_empty(&pointer->events.pinch_end.listener_list));
assert(wl_list_empty(&pointer->events.hold_begin.listener_list));
assert(wl_list_empty(&pointer->events.hold_end.listener_list));
free(pointer->output_name); free(pointer->output_name);
} }

View file

@ -47,6 +47,9 @@ static void pointer_constraint_destroy(struct wlr_pointer_constraint_v1 *constra
wl_signal_emit_mutable(&constraint->events.destroy, constraint); wl_signal_emit_mutable(&constraint->events.destroy, constraint);
assert(wl_list_empty(&constraint->events.set_region.listener_list));
assert(wl_list_empty(&constraint->events.destroy.listener_list));
wl_resource_set_user_data(constraint->resource, NULL); wl_resource_set_user_data(constraint->resource, NULL);
wlr_surface_synced_finish(&constraint->synced); wlr_surface_synced_finish(&constraint->synced);
wl_list_remove(&constraint->link); wl_list_remove(&constraint->link);
@ -323,6 +326,10 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_pointer_constraints_v1 *pointer_constraints = struct wlr_pointer_constraints_v1 *pointer_constraints =
wl_container_of(listener, pointer_constraints, display_destroy); wl_container_of(listener, pointer_constraints, display_destroy);
wl_signal_emit_mutable(&pointer_constraints->events.destroy, NULL); wl_signal_emit_mutable(&pointer_constraints->events.destroy, NULL);
assert(wl_list_empty(&pointer_constraints->events.destroy.listener_list));
assert(wl_list_empty(&pointer_constraints->events.new_constraint.listener_list));
wl_list_remove(&pointer_constraints->display_destroy.link); wl_list_remove(&pointer_constraints->display_destroy.link);
wl_global_destroy(pointer_constraints->global); wl_global_destroy(pointer_constraints->global);
free(pointer_constraints); free(pointer_constraints);

View file

@ -397,6 +397,9 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_pointer_gestures_v1 *gestures = struct wlr_pointer_gestures_v1 *gestures =
wl_container_of(listener, gestures, display_destroy); wl_container_of(listener, gestures, display_destroy);
wl_signal_emit_mutable(&gestures->events.destroy, NULL); wl_signal_emit_mutable(&gestures->events.destroy, NULL);
assert(wl_list_empty(&gestures->events.destroy.listener_list));
wl_list_remove(&gestures->display_destroy.link); wl_list_remove(&gestures->display_destroy.link);
wl_global_destroy(gestures->global); wl_global_destroy(gestures->global);
free(gestures); free(gestures);

View file

@ -166,6 +166,9 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_presentation *presentation = struct wlr_presentation *presentation =
wl_container_of(listener, presentation, display_destroy); wl_container_of(listener, presentation, display_destroy);
wl_signal_emit_mutable(&presentation->events.destroy, presentation); wl_signal_emit_mutable(&presentation->events.destroy, presentation);
assert(wl_list_empty(&presentation->events.destroy.listener_list));
wl_list_remove(&presentation->display_destroy.link); wl_list_remove(&presentation->display_destroy.link);
wl_global_destroy(presentation->global); wl_global_destroy(presentation->global);
free(presentation); free(presentation);

View file

@ -11,6 +11,7 @@ void wlr_primary_selection_source_init(
.impl = impl, .impl = impl,
}; };
wl_array_init(&source->mime_types); wl_array_init(&source->mime_types);
wl_signal_init(&source->events.destroy); wl_signal_init(&source->events.destroy);
} }
@ -22,6 +23,8 @@ void wlr_primary_selection_source_destroy(
wl_signal_emit_mutable(&source->events.destroy, source); wl_signal_emit_mutable(&source->events.destroy, source);
assert(wl_list_empty(&source->events.destroy.listener_list));
char **p; char **p;
wl_array_for_each(p, &source->mime_types) { wl_array_for_each(p, &source->mime_types) {
free(*p); free(*p);

View file

@ -462,6 +462,9 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
} }
wl_signal_emit_mutable(&manager->events.destroy, manager); wl_signal_emit_mutable(&manager->events.destroy, manager);
assert(wl_list_empty(&manager->events.destroy.listener_list));
wl_list_remove(&manager->display_destroy.link); wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global); wl_global_destroy(manager->global);
free(manager); free(manager);
@ -483,6 +486,7 @@ struct wlr_primary_selection_v1_device_manager *
} }
wl_list_init(&manager->devices); wl_list_init(&manager->devices);
wl_signal_init(&manager->events.destroy); wl_signal_init(&manager->events.destroy);
manager->display_destroy.notify = handle_display_destroy; manager->display_destroy.notify = handle_display_destroy;

View file

@ -28,6 +28,8 @@ static struct wlr_relative_pointer_manager_v1 *relative_pointer_manager_from_res
static void relative_pointer_destroy(struct wlr_relative_pointer_v1 *relative_pointer) { static void relative_pointer_destroy(struct wlr_relative_pointer_v1 *relative_pointer) {
wl_signal_emit_mutable(&relative_pointer->events.destroy, relative_pointer); wl_signal_emit_mutable(&relative_pointer->events.destroy, relative_pointer);
assert(wl_list_empty(&relative_pointer->events.destroy.listener_list));
wl_list_remove(&relative_pointer->link); wl_list_remove(&relative_pointer->link);
wl_list_remove(&relative_pointer->seat_destroy.link); wl_list_remove(&relative_pointer->seat_destroy.link);
wl_list_remove(&relative_pointer->pointer_destroy.link); wl_list_remove(&relative_pointer->pointer_destroy.link);
@ -139,6 +141,10 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_relative_pointer_manager_v1 *manager = struct wlr_relative_pointer_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy_listener); wl_container_of(listener, manager, display_destroy_listener);
wl_signal_emit_mutable(&manager->events.destroy, manager); wl_signal_emit_mutable(&manager->events.destroy, manager);
assert(wl_list_empty(&manager->events.destroy.listener_list));
assert(wl_list_empty(&manager->events.new_relative_pointer.listener_list));
wl_list_remove(&manager->display_destroy_listener.link); wl_list_remove(&manager->display_destroy_listener.link);
wl_global_destroy(manager->global); wl_global_destroy(manager->global);
free(manager); free(manager);

View file

@ -700,6 +700,9 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_screencopy_manager_v1 *manager = struct wlr_screencopy_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy); wl_container_of(listener, manager, display_destroy);
wl_signal_emit_mutable(&manager->events.destroy, manager); wl_signal_emit_mutable(&manager->events.destroy, manager);
assert(wl_list_empty(&manager->events.destroy.listener_list));
wl_list_remove(&manager->display_destroy.link); wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global); wl_global_destroy(manager->global);
free(manager); free(manager);

View file

@ -390,6 +390,7 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_security_context_manager_v1 *manager = struct wlr_security_context_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy); wl_container_of(listener, manager, display_destroy);
wl_signal_emit_mutable(&manager->events.destroy, manager); wl_signal_emit_mutable(&manager->events.destroy, manager);
assert(wl_list_empty(&manager->events.destroy.listener_list)); assert(wl_list_empty(&manager->events.destroy.listener_list));
assert(wl_list_empty(&manager->events.commit.listener_list)); assert(wl_list_empty(&manager->events.commit.listener_list));
@ -419,6 +420,7 @@ struct wlr_security_context_manager_v1 *wlr_security_context_manager_v1_create(
} }
wl_list_init(&manager->contexts); wl_list_init(&manager->contexts);
wl_signal_init(&manager->events.destroy); wl_signal_init(&manager->events.destroy);
wl_signal_init(&manager->events.commit); wl_signal_init(&manager->events.commit);

View file

@ -36,6 +36,10 @@ static void server_decoration_handle_request_mode(struct wl_client *client,
static void server_decoration_destroy( static void server_decoration_destroy(
struct wlr_server_decoration *decoration) { struct wlr_server_decoration *decoration) {
wl_signal_emit_mutable(&decoration->events.destroy, decoration); wl_signal_emit_mutable(&decoration->events.destroy, decoration);
assert(wl_list_empty(&decoration->events.destroy.listener_list));
assert(wl_list_empty(&decoration->events.mode.listener_list));
wl_list_remove(&decoration->surface_destroy_listener.link); wl_list_remove(&decoration->surface_destroy_listener.link);
wl_resource_set_user_data(decoration->resource, NULL); wl_resource_set_user_data(decoration->resource, NULL);
wl_list_remove(&decoration->link); wl_list_remove(&decoration->link);
@ -164,6 +168,10 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_server_decoration_manager *manager = struct wlr_server_decoration_manager *manager =
wl_container_of(listener, manager, display_destroy); wl_container_of(listener, manager, display_destroy);
wl_signal_emit_mutable(&manager->events.destroy, manager); wl_signal_emit_mutable(&manager->events.destroy, manager);
assert(wl_list_empty(&manager->events.new_decoration.listener_list));
assert(wl_list_empty(&manager->events.destroy.listener_list));
wl_list_remove(&manager->display_destroy.link); wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global); wl_global_destroy(manager->global);
free(manager); free(manager);
@ -185,6 +193,7 @@ struct wlr_server_decoration_manager *wlr_server_decoration_manager_create(
manager->default_mode = ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_NONE; manager->default_mode = ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_NONE;
wl_list_init(&manager->resources); wl_list_init(&manager->resources);
wl_list_init(&manager->decorations); wl_list_init(&manager->decorations);
wl_signal_init(&manager->events.new_decoration); wl_signal_init(&manager->events.new_decoration);
wl_signal_init(&manager->events.destroy); wl_signal_init(&manager->events.destroy);

View file

@ -33,6 +33,8 @@ static void subsurface_destroy(struct wlr_subsurface *subsurface) {
wl_signal_emit_mutable(&subsurface->events.destroy, subsurface); wl_signal_emit_mutable(&subsurface->events.destroy, subsurface);
assert(wl_list_empty(&subsurface->events.destroy.listener_list));
wlr_surface_synced_finish(&subsurface->parent_synced); wlr_surface_synced_finish(&subsurface->parent_synced);
wl_list_remove(&subsurface->surface_client_commit.link); wl_list_remove(&subsurface->surface_client_commit.link);
@ -406,6 +408,9 @@ static void subcompositor_handle_display_destroy(
struct wlr_subcompositor *subcompositor = struct wlr_subcompositor *subcompositor =
wl_container_of(listener, subcompositor, display_destroy); wl_container_of(listener, subcompositor, display_destroy);
wl_signal_emit_mutable(&subcompositor->events.destroy, NULL); wl_signal_emit_mutable(&subcompositor->events.destroy, NULL);
assert(wl_list_empty(&subcompositor->events.destroy.listener_list));
wl_list_remove(&subcompositor->display_destroy.link); wl_list_remove(&subcompositor->display_destroy.link);
wl_global_destroy(subcompositor->global); wl_global_destroy(subcompositor->global);
free(subcompositor); free(subcompositor);

View file

@ -25,4 +25,6 @@ void wlr_switch_init(struct wlr_switch *switch_device,
void wlr_switch_finish(struct wlr_switch *switch_device) { void wlr_switch_finish(struct wlr_switch *switch_device) {
wlr_input_device_finish(&switch_device->base); wlr_input_device_finish(&switch_device->base);
assert(wl_list_empty(&switch_device->events.toggle.listener_list));
} }

View file

@ -33,6 +33,11 @@ void wlr_tablet_pad_init(struct wlr_tablet_pad *pad,
void wlr_tablet_pad_finish(struct wlr_tablet_pad *pad) { void wlr_tablet_pad_finish(struct wlr_tablet_pad *pad) {
wlr_input_device_finish(&pad->base); wlr_input_device_finish(&pad->base);
assert(wl_list_empty(&pad->events.button.listener_list));
assert(wl_list_empty(&pad->events.ring.listener_list));
assert(wl_list_empty(&pad->events.strip.listener_list));
assert(wl_list_empty(&pad->events.attach_tablet.listener_list));
char **path_ptr; char **path_ptr;
wl_array_for_each(path_ptr, &pad->paths) { wl_array_for_each(path_ptr, &pad->paths) {
free(*path_ptr); free(*path_ptr);

View file

@ -24,12 +24,18 @@ void wlr_tablet_init(struct wlr_tablet *tablet,
wl_signal_init(&tablet->events.proximity); wl_signal_init(&tablet->events.proximity);
wl_signal_init(&tablet->events.tip); wl_signal_init(&tablet->events.tip);
wl_signal_init(&tablet->events.button); wl_signal_init(&tablet->events.button);
wl_array_init(&tablet->paths); wl_array_init(&tablet->paths);
} }
void wlr_tablet_finish(struct wlr_tablet *tablet) { void wlr_tablet_finish(struct wlr_tablet *tablet) {
wlr_input_device_finish(&tablet->base); wlr_input_device_finish(&tablet->base);
assert(wl_list_empty(&tablet->events.axis.listener_list));
assert(wl_list_empty(&tablet->events.proximity.listener_list));
assert(wl_list_empty(&tablet->events.tip.listener_list));
assert(wl_list_empty(&tablet->events.button.listener_list));
char **path_ptr; char **path_ptr;
wl_array_for_each(path_ptr, &tablet->paths) { wl_array_for_each(path_ptr, &tablet->paths) {
free(*path_ptr); free(*path_ptr);

View file

@ -34,6 +34,9 @@ static void destroy_tearing_hint(struct wlr_tearing_control_v1 *hint) {
wl_signal_emit_mutable(&hint->events.destroy, NULL); wl_signal_emit_mutable(&hint->events.destroy, NULL);
assert(wl_list_empty(&hint->events.set_hint.listener_list));
assert(wl_list_empty(&hint->events.destroy.listener_list));
wl_list_remove(&hint->link); wl_list_remove(&hint->link);
wl_resource_set_user_data(hint->resource, NULL); wl_resource_set_user_data(hint->resource, NULL);
@ -170,6 +173,9 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
wl_signal_emit_mutable(&manager->events.destroy, NULL); wl_signal_emit_mutable(&manager->events.destroy, NULL);
assert(wl_list_empty(&manager->events.new_object.listener_list));
assert(wl_list_empty(&manager->events.destroy.listener_list));
struct wlr_tearing_control_v1 *hint, *tmp; struct wlr_tearing_control_v1 *hint, *tmp;
wl_list_for_each_safe(hint, tmp, &manager->surface_hints, link) { wl_list_for_each_safe(hint, tmp, &manager->surface_hints, link) {
destroy_tearing_hint(hint); destroy_tearing_hint(hint);

View file

@ -65,6 +65,12 @@ void wlr_text_input_v3_send_done(struct wlr_text_input_v3 *text_input) {
static void wlr_text_input_destroy(struct wlr_text_input_v3 *text_input) { static void wlr_text_input_destroy(struct wlr_text_input_v3 *text_input) {
wl_signal_emit_mutable(&text_input->events.destroy, text_input); wl_signal_emit_mutable(&text_input->events.destroy, text_input);
assert(wl_list_empty(&text_input->events.enable.listener_list));
assert(wl_list_empty(&text_input->events.commit.listener_list));
assert(wl_list_empty(&text_input->events.disable.listener_list));
assert(wl_list_empty(&text_input->events.destroy.listener_list));
text_input_clear_focused_surface(text_input); text_input_clear_focused_surface(text_input);
wl_list_remove(&text_input->seat_destroy.link); wl_list_remove(&text_input->seat_destroy.link);
// remove from manager.text_inputs // remove from manager.text_inputs
@ -308,6 +314,10 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_text_input_manager_v3 *manager = struct wlr_text_input_manager_v3 *manager =
wl_container_of(listener, manager, display_destroy); wl_container_of(listener, manager, display_destroy);
wl_signal_emit_mutable(&manager->events.destroy, manager); wl_signal_emit_mutable(&manager->events.destroy, manager);
assert(wl_list_empty(&manager->events.text_input.listener_list));
assert(wl_list_empty(&manager->events.destroy.listener_list));
wl_list_remove(&manager->display_destroy.link); wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global); wl_global_destroy(manager->global);
free(manager); free(manager);
@ -321,6 +331,7 @@ struct wlr_text_input_manager_v3 *wlr_text_input_manager_v3_create(
} }
wl_list_init(&manager->text_inputs); wl_list_init(&manager->text_inputs);
wl_signal_init(&manager->events.text_input); wl_signal_init(&manager->events.text_input);
wl_signal_init(&manager->events.destroy); wl_signal_init(&manager->events.destroy);

View file

@ -30,5 +30,11 @@ void wlr_touch_init(struct wlr_touch *touch,
void wlr_touch_finish(struct wlr_touch *touch) { void wlr_touch_finish(struct wlr_touch *touch) {
wlr_input_device_finish(&touch->base); wlr_input_device_finish(&touch->base);
assert(wl_list_empty(&touch->events.down.listener_list));
assert(wl_list_empty(&touch->events.up.listener_list));
assert(wl_list_empty(&touch->events.motion.listener_list));
assert(wl_list_empty(&touch->events.cancel.listener_list));
assert(wl_list_empty(&touch->events.frame.listener_list));
free(touch->output_name); free(touch->output_name);
} }

View file

@ -115,6 +115,10 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_transient_seat_manager_v1 *manager = struct wlr_transient_seat_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy); wl_container_of(listener, manager, display_destroy);
wl_signal_emit_mutable(&manager->events.destroy, NULL); wl_signal_emit_mutable(&manager->events.destroy, NULL);
assert(wl_list_empty(&manager->events.destroy.listener_list));
assert(wl_list_empty(&manager->events.create_seat.listener_list));
wl_list_remove(&manager->display_destroy.link); wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global); wl_global_destroy(manager->global);
free(manager); free(manager);

View file

@ -230,6 +230,9 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_viewporter *viewporter = struct wlr_viewporter *viewporter =
wl_container_of(listener, viewporter, display_destroy); wl_container_of(listener, viewporter, display_destroy);
wl_signal_emit_mutable(&viewporter->events.destroy, NULL); wl_signal_emit_mutable(&viewporter->events.destroy, NULL);
assert(wl_list_empty(&viewporter->events.destroy.listener_list));
wl_global_destroy(viewporter->global); wl_global_destroy(viewporter->global);
free(viewporter); free(viewporter);
} }

View file

@ -209,6 +209,10 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_virtual_keyboard_manager_v1 *manager = struct wlr_virtual_keyboard_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy); wl_container_of(listener, manager, display_destroy);
wl_signal_emit_mutable(&manager->events.destroy, manager); wl_signal_emit_mutable(&manager->events.destroy, manager);
assert(wl_list_empty(&manager->events.new_virtual_keyboard.listener_list));
assert(wl_list_empty(&manager->events.destroy.listener_list));
wl_list_remove(&manager->display_destroy.link); wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global); wl_global_destroy(manager->global);
free(manager); free(manager);

View file

@ -308,6 +308,10 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_virtual_pointer_manager_v1 *manager = struct wlr_virtual_pointer_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy); wl_container_of(listener, manager, display_destroy);
wl_signal_emit_mutable(&manager->events.destroy, manager); wl_signal_emit_mutable(&manager->events.destroy, manager);
assert(wl_list_empty(&manager->events.new_virtual_pointer.listener_list));
assert(wl_list_empty(&manager->events.destroy.listener_list));
wl_list_remove(&manager->display_destroy.link); wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global); wl_global_destroy(manager->global);
struct wlr_virtual_pointer_v1 *pointer, *pointer_tmp; struct wlr_virtual_pointer_v1 *pointer, *pointer_tmp;
@ -329,6 +333,7 @@ struct wlr_virtual_pointer_manager_v1* wlr_virtual_pointer_manager_v1_create(
wl_signal_init(&manager->events.new_virtual_pointer); wl_signal_init(&manager->events.new_virtual_pointer);
wl_signal_init(&manager->events.destroy); wl_signal_init(&manager->events.destroy);
manager->global = wl_global_create(display, manager->global = wl_global_create(display,
&zwlr_virtual_pointer_manager_v1_interface, 2, manager, &zwlr_virtual_pointer_manager_v1_interface, 2, manager,
virtual_pointer_manager_bind); virtual_pointer_manager_bind);

View file

@ -33,6 +33,8 @@ void wlr_xdg_activation_token_v1_destroy(
wl_signal_emit_mutable(&token->events.destroy, NULL); wl_signal_emit_mutable(&token->events.destroy, NULL);
assert(wl_list_empty(&token->events.destroy.listener_list));
wl_list_remove(&token->link); wl_list_remove(&token->link);
wl_list_remove(&token->seat_destroy.link); wl_list_remove(&token->seat_destroy.link);
wl_list_remove(&token->surface_destroy.link); wl_list_remove(&token->surface_destroy.link);
@ -256,6 +258,7 @@ static struct wlr_xdg_activation_token_v1 *activation_token_create(
wl_list_init(&token->link); wl_list_init(&token->link);
wl_list_init(&token->seat_destroy.link); wl_list_init(&token->seat_destroy.link);
wl_list_init(&token->surface_destroy.link); wl_list_init(&token->surface_destroy.link);
wl_signal_init(&token->events.destroy); wl_signal_init(&token->events.destroy);
token->activation = activation; token->activation = activation;
@ -340,6 +343,10 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
wl_container_of(listener, activation, display_destroy); wl_container_of(listener, activation, display_destroy);
wl_signal_emit_mutable(&activation->events.destroy, NULL); wl_signal_emit_mutable(&activation->events.destroy, NULL);
assert(wl_list_empty(&activation->events.destroy.listener_list));
assert(wl_list_empty(&activation->events.request_activate.listener_list));
assert(wl_list_empty(&activation->events.new_token.listener_list));
struct wlr_xdg_activation_token_v1 *token, *token_tmp; struct wlr_xdg_activation_token_v1 *token, *token_tmp;
wl_list_for_each_safe(token, token_tmp, &activation->tokens, link) { wl_list_for_each_safe(token, token_tmp, &activation->tokens, link) {
wlr_xdg_activation_token_v1_destroy(token); wlr_xdg_activation_token_v1_destroy(token);
@ -359,6 +366,7 @@ struct wlr_xdg_activation_v1 *wlr_xdg_activation_v1_create(
activation->token_timeout_msec = 30000; // 30s activation->token_timeout_msec = 30000; // 30s
wl_list_init(&activation->tokens); wl_list_init(&activation->tokens);
wl_signal_init(&activation->events.destroy); wl_signal_init(&activation->events.destroy);
wl_signal_init(&activation->events.request_activate); wl_signal_init(&activation->events.request_activate);
wl_signal_init(&activation->events.new_token); wl_signal_init(&activation->events.new_token);

View file

@ -62,6 +62,10 @@ static void toplevel_decoration_handle_resource_destroy(
struct wlr_xdg_toplevel_decoration_v1 *decoration = struct wlr_xdg_toplevel_decoration_v1 *decoration =
toplevel_decoration_from_resource(resource); toplevel_decoration_from_resource(resource);
wl_signal_emit_mutable(&decoration->events.destroy, decoration); wl_signal_emit_mutable(&decoration->events.destroy, decoration);
assert(wl_list_empty(&decoration->events.destroy.listener_list));
assert(wl_list_empty(&decoration->events.request_mode.listener_list));
wlr_surface_synced_finish(&decoration->synced); wlr_surface_synced_finish(&decoration->synced);
wl_list_remove(&decoration->toplevel_destroy.link); wl_list_remove(&decoration->toplevel_destroy.link);
wl_list_remove(&decoration->surface_configure.link); wl_list_remove(&decoration->surface_configure.link);
@ -217,6 +221,7 @@ static void decoration_manager_handle_get_toplevel_decoration(
decoration->resource); decoration->resource);
wl_list_init(&decoration->configure_list); wl_list_init(&decoration->configure_list);
wl_signal_init(&decoration->events.destroy); wl_signal_init(&decoration->events.destroy);
wl_signal_init(&decoration->events.request_mode); wl_signal_init(&decoration->events.request_mode);
@ -256,6 +261,10 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_xdg_decoration_manager_v1 *manager = struct wlr_xdg_decoration_manager_v1 *manager =
wl_container_of(listener, manager, display_destroy); wl_container_of(listener, manager, display_destroy);
wl_signal_emit_mutable(&manager->events.destroy, manager); wl_signal_emit_mutable(&manager->events.destroy, manager);
assert(wl_list_empty(&manager->events.new_toplevel_decoration.listener_list));
assert(wl_list_empty(&manager->events.destroy.listener_list));
wl_list_remove(&manager->display_destroy.link); wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global); wl_global_destroy(manager->global);
free(manager); free(manager);
@ -275,6 +284,7 @@ struct wlr_xdg_decoration_manager_v1 *
return NULL; return NULL;
} }
wl_list_init(&manager->decorations); wl_list_init(&manager->decorations);
wl_signal_init(&manager->events.new_toplevel_decoration); wl_signal_init(&manager->events.new_toplevel_decoration);
wl_signal_init(&manager->events.destroy); wl_signal_init(&manager->events.destroy);

View file

@ -76,6 +76,9 @@ static void dialog_destroy(struct wlr_xdg_dialog_v1 *dialog) {
wl_signal_emit_mutable(&dialog->events.destroy, NULL); wl_signal_emit_mutable(&dialog->events.destroy, NULL);
assert(wl_list_empty(&dialog->events.destroy.listener_list));
assert(wl_list_empty(&dialog->events.set_modal.listener_list));
wlr_addon_finish(&dialog->surface_addon); wlr_addon_finish(&dialog->surface_addon);
wl_list_remove(&dialog->xdg_toplevel_destroy.link); wl_list_remove(&dialog->xdg_toplevel_destroy.link);
@ -154,6 +157,9 @@ static void xdg_wm_dialog_handle_display_destroy(struct wl_listener *listener, v
struct wlr_xdg_wm_dialog_v1 *wm = wl_container_of(listener, wm, display_destroy); struct wlr_xdg_wm_dialog_v1 *wm = wl_container_of(listener, wm, display_destroy);
wl_signal_emit_mutable(&wm->events.destroy, NULL); wl_signal_emit_mutable(&wm->events.destroy, NULL);
assert(wl_list_empty(&wm->events.destroy.listener_list));
assert(wl_list_empty(&wm->events.new_dialog.listener_list));
wl_list_remove(&wm->display_destroy.link); wl_list_remove(&wm->display_destroy.link);
wl_global_destroy(wm->global); wl_global_destroy(wm->global);
free(wm); free(wm);

View file

@ -17,6 +17,7 @@ bool wlr_xdg_foreign_exported_init(
wl_list_insert(&registry->exported_surfaces, &exported->link); wl_list_insert(&registry->exported_surfaces, &exported->link);
wl_signal_init(&exported->events.destroy); wl_signal_init(&exported->events.destroy);
return true; return true;
} }
@ -38,6 +39,9 @@ struct wlr_xdg_foreign_exported *wlr_xdg_foreign_registry_find_by_handle(
void wlr_xdg_foreign_exported_finish(struct wlr_xdg_foreign_exported *surface) { void wlr_xdg_foreign_exported_finish(struct wlr_xdg_foreign_exported *surface) {
wl_signal_emit_mutable(&surface->events.destroy, NULL); wl_signal_emit_mutable(&surface->events.destroy, NULL);
assert(wl_list_empty(&surface->events.destroy.listener_list));
surface->registry = NULL; surface->registry = NULL;
wl_list_remove(&surface->link); wl_list_remove(&surface->link);
wl_list_init(&surface->link); wl_list_init(&surface->link);
@ -50,6 +54,8 @@ static void foreign_registry_handle_display_destroy(struct wl_listener *listener
wl_signal_emit_mutable(&registry->events.destroy, NULL); wl_signal_emit_mutable(&registry->events.destroy, NULL);
assert(wl_list_empty(&registry->events.destroy.listener_list));
// Implementations are supposed to remove all surfaces // Implementations are supposed to remove all surfaces
assert(wl_list_empty(&registry->exported_surfaces)); assert(wl_list_empty(&registry->exported_surfaces));
free(registry); free(registry);
@ -67,6 +73,8 @@ struct wlr_xdg_foreign_registry *wlr_xdg_foreign_registry_create(
wl_display_add_destroy_listener(display, &registry->display_destroy); wl_display_add_destroy_listener(display, &registry->display_destroy);
wl_list_init(&registry->exported_surfaces); wl_list_init(&registry->exported_surfaces);
wl_signal_init(&registry->events.destroy); wl_signal_init(&registry->events.destroy);
return registry; return registry;
} }

View file

@ -345,6 +345,9 @@ static void xdg_foreign_destroy(struct wlr_xdg_foreign_v1 *foreign) {
} }
wl_signal_emit_mutable(&foreign->events.destroy, NULL); wl_signal_emit_mutable(&foreign->events.destroy, NULL);
assert(wl_list_empty(&foreign->events.destroy.listener_list));
wl_list_remove(&foreign->foreign_registry_destroy.link); wl_list_remove(&foreign->foreign_registry_destroy.link);
wl_list_remove(&foreign->display_destroy.link); wl_list_remove(&foreign->display_destroy.link);
@ -395,6 +398,7 @@ struct wlr_xdg_foreign_v1 *wlr_xdg_foreign_v1_create(
foreign->registry = registry; foreign->registry = registry;
wl_signal_init(&foreign->events.destroy); wl_signal_init(&foreign->events.destroy);
wl_list_init(&foreign->exporter.objects); wl_list_init(&foreign->exporter.objects);
wl_list_init(&foreign->importer.objects); wl_list_init(&foreign->importer.objects);

View file

@ -348,6 +348,9 @@ static void xdg_foreign_destroy(struct wlr_xdg_foreign_v2 *foreign) {
} }
wl_signal_emit_mutable(&foreign->events.destroy, NULL); wl_signal_emit_mutable(&foreign->events.destroy, NULL);
assert(wl_list_empty(&foreign->events.destroy.listener_list));
wl_list_remove(&foreign->foreign_registry_destroy.link); wl_list_remove(&foreign->foreign_registry_destroy.link);
wl_list_remove(&foreign->display_destroy.link); wl_list_remove(&foreign->display_destroy.link);
@ -398,6 +401,7 @@ struct wlr_xdg_foreign_v2 *wlr_xdg_foreign_v2_create(
foreign->registry = registry; foreign->registry = registry;
wl_signal_init(&foreign->events.destroy); wl_signal_init(&foreign->events.destroy);
wl_list_init(&foreign->exporter.objects); wl_list_init(&foreign->exporter.objects);
wl_list_init(&foreign->importer.objects); wl_list_init(&foreign->importer.objects);

View file

@ -140,7 +140,7 @@ static void output_manager_handle_get_xdg_output(struct wl_client *client,
output_send_details(xdg_output, xdg_output_resource); output_send_details(xdg_output, xdg_output_resource);
uint32_t wl_version = wl_resource_get_version(output_resource); uint32_t wl_version = wl_resource_get_version(output_resource);
if (wl_version >= WL_OUTPUT_DONE_SINCE_VERSION && if (wl_version >= WL_OUTPUT_DONE_SINCE_VERSION &&
xdg_version >= OUTPUT_DONE_DEPRECATED_SINCE_VERSION) { xdg_version >= OUTPUT_DONE_DEPRECATED_SINCE_VERSION) {
wl_output_send_done(output_resource); wl_output_send_done(output_resource);
} }
@ -234,7 +234,11 @@ static void manager_destroy(struct wlr_xdg_output_manager_v1 *manager) {
wl_list_for_each_safe(output, tmp, &manager->outputs, link) { wl_list_for_each_safe(output, tmp, &manager->outputs, link) {
output_destroy(output); output_destroy(output);
} }
wl_signal_emit_mutable(&manager->events.destroy, manager); wl_signal_emit_mutable(&manager->events.destroy, manager);
assert(wl_list_empty(&manager->events.destroy.listener_list));
wl_list_remove(&manager->display_destroy.link); wl_list_remove(&manager->display_destroy.link);
wl_list_remove(&manager->layout_add.link); wl_list_remove(&manager->layout_add.link);
wl_list_remove(&manager->layout_change.link); wl_list_remove(&manager->layout_change.link);

View file

@ -52,6 +52,10 @@ static void bell_bind(struct wl_client *client, void *data,
static void handle_display_destroy(struct wl_listener *listener, void *data) { static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_xdg_system_bell_v1 *bell = wl_container_of(listener, bell, display_destroy); struct wlr_xdg_system_bell_v1 *bell = wl_container_of(listener, bell, display_destroy);
wl_signal_emit_mutable(&bell->events.destroy, NULL); wl_signal_emit_mutable(&bell->events.destroy, NULL);
assert(wl_list_empty(&bell->events.destroy.listener_list));
assert(wl_list_empty(&bell->events.ring.listener_list));
wl_list_remove(&bell->display_destroy.link); wl_list_remove(&bell->display_destroy.link);
wl_global_destroy(bell->global); wl_global_destroy(bell->global);
free(bell); free(bell);

View file

@ -229,6 +229,9 @@ static void manager_handle_display_destroy(struct wl_listener *listener, void *d
wl_signal_emit_mutable(&manager->events.destroy, NULL); wl_signal_emit_mutable(&manager->events.destroy, NULL);
assert(wl_list_empty(&manager->events.set_icon.listener_list));
assert(wl_list_empty(&manager->events.destroy.listener_list));
wl_list_remove(&manager->display_destroy.link); wl_list_remove(&manager->display_destroy.link);
wl_global_destroy(manager->global); wl_global_destroy(manager->global);

View file

@ -467,6 +467,9 @@ void destroy_xdg_popup(struct wlr_xdg_popup *popup) {
wl_signal_emit_mutable(&popup->events.destroy, NULL); wl_signal_emit_mutable(&popup->events.destroy, NULL);
assert(wl_list_empty(&popup->events.destroy.listener_list));
assert(wl_list_empty(&popup->events.reposition.listener_list));
wlr_surface_synced_finish(&popup->synced); wlr_surface_synced_finish(&popup->synced);
popup->base->popup = NULL; popup->base->popup = NULL;
wl_list_remove(&popup->link); wl_list_remove(&popup->link);

View file

@ -129,6 +129,12 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_xdg_shell *xdg_shell = struct wlr_xdg_shell *xdg_shell =
wl_container_of(listener, xdg_shell, display_destroy); wl_container_of(listener, xdg_shell, display_destroy);
wl_signal_emit_mutable(&xdg_shell->events.destroy, xdg_shell); wl_signal_emit_mutable(&xdg_shell->events.destroy, xdg_shell);
assert(wl_list_empty(&xdg_shell->events.new_surface.listener_list));
assert(wl_list_empty(&xdg_shell->events.new_toplevel.listener_list));
assert(wl_list_empty(&xdg_shell->events.new_popup.listener_list));
assert(wl_list_empty(&xdg_shell->events.destroy.listener_list));
wl_list_remove(&xdg_shell->display_destroy.link); wl_list_remove(&xdg_shell->display_destroy.link);
wl_global_destroy(xdg_shell->global); wl_global_destroy(xdg_shell->global);
free(xdg_shell); free(xdg_shell);

View file

@ -523,6 +523,12 @@ void destroy_xdg_surface(struct wlr_xdg_surface *surface) {
wl_signal_emit_mutable(&surface->events.destroy, NULL); wl_signal_emit_mutable(&surface->events.destroy, NULL);
assert(wl_list_empty(&surface->events.destroy.listener_list));
assert(wl_list_empty(&surface->events.ping_timeout.listener_list));
assert(wl_list_empty(&surface->events.new_popup.listener_list));
assert(wl_list_empty(&surface->events.configure.listener_list));
assert(wl_list_empty(&surface->events.ack_configure.listener_list));
wl_list_remove(&surface->link); wl_list_remove(&surface->link);
wlr_surface_synced_finish(&surface->synced); wlr_surface_synced_finish(&surface->synced);
wl_resource_set_user_data(surface->resource, NULL); wl_resource_set_user_data(surface->resource, NULL);

View file

@ -525,6 +525,17 @@ void destroy_xdg_toplevel(struct wlr_xdg_toplevel *toplevel) {
wl_signal_emit_mutable(&toplevel->events.destroy, NULL); wl_signal_emit_mutable(&toplevel->events.destroy, NULL);
assert(wl_list_empty(&toplevel->events.destroy.listener_list));
assert(wl_list_empty(&toplevel->events.request_maximize.listener_list));
assert(wl_list_empty(&toplevel->events.request_fullscreen.listener_list));
assert(wl_list_empty(&toplevel->events.request_minimize.listener_list));
assert(wl_list_empty(&toplevel->events.request_move.listener_list));
assert(wl_list_empty(&toplevel->events.request_resize.listener_list));
assert(wl_list_empty(&toplevel->events.request_show_window_menu.listener_list));
assert(wl_list_empty(&toplevel->events.set_parent.listener_list));
assert(wl_list_empty(&toplevel->events.set_title.listener_list));
assert(wl_list_empty(&toplevel->events.set_app_id.listener_list));
wlr_surface_synced_finish(&toplevel->synced); wlr_surface_synced_finish(&toplevel->synced);
toplevel->base->toplevel = NULL; toplevel->base->toplevel = NULL;
wl_resource_set_user_data(toplevel->resource, NULL); wl_resource_set_user_data(toplevel->resource, NULL);

View file

@ -455,7 +455,13 @@ void wlr_xwayland_server_destroy(struct wlr_xwayland_server *server) {
} }
server_finish_process(server); server_finish_process(server);
server_finish_display(server); server_finish_display(server);
wl_signal_emit_mutable(&server->events.destroy, NULL); wl_signal_emit_mutable(&server->events.destroy, NULL);
assert(wl_list_empty(&server->events.start.listener_list));
assert(wl_list_empty(&server->events.ready.listener_list));
assert(wl_list_empty(&server->events.destroy.listener_list));
free(server); free(server);
} }

View file

@ -178,6 +178,7 @@ struct wlr_xwayland_shell_v1 *wlr_xwayland_shell_v1_create(
} }
wl_list_init(&shell->surfaces); wl_list_init(&shell->surfaces);
wl_signal_init(&shell->events.new_surface); wl_signal_init(&shell->events.new_surface);
wl_signal_init(&shell->events.destroy); wl_signal_init(&shell->events.destroy);
@ -196,6 +197,9 @@ void wlr_xwayland_shell_v1_destroy(struct wlr_xwayland_shell_v1 *shell) {
wl_signal_emit_mutable(&shell->events.destroy, NULL); wl_signal_emit_mutable(&shell->events.destroy, NULL);
assert(wl_list_empty(&shell->events.new_surface.listener_list));
assert(wl_list_empty(&shell->events.destroy.listener_list));
struct wlr_xwayland_surface_v1 *xwl_surface, *tmp; struct wlr_xwayland_surface_v1 *xwl_surface, *tmp;
wl_list_for_each_safe(xwl_surface, tmp, &shell->surfaces, link) { wl_list_for_each_safe(xwl_surface, tmp, &shell->surfaces, link) {
xwl_surface_destroy(xwl_surface); xwl_surface_destroy(xwl_surface);

View file

@ -81,6 +81,11 @@ void wlr_xwayland_destroy(struct wlr_xwayland *xwayland) {
wl_signal_emit_mutable(&xwayland->events.destroy, NULL); wl_signal_emit_mutable(&xwayland->events.destroy, NULL);
assert(wl_list_empty(&xwayland->events.destroy.listener_list));
assert(wl_list_empty(&xwayland->events.new_surface.listener_list));
assert(wl_list_empty(&xwayland->events.ready.listener_list));
assert(wl_list_empty(&xwayland->events.remove_startup_info.listener_list));
wl_list_remove(&xwayland->server_destroy.link); wl_list_remove(&xwayland->server_destroy.link);
wl_list_remove(&xwayland->server_start.link); wl_list_remove(&xwayland->server_start.link);
wl_list_remove(&xwayland->server_ready.link); wl_list_remove(&xwayland->server_ready.link);

View file

@ -209,6 +209,7 @@ static struct wlr_xwayland_surface *xwayland_surface_create(
wl_list_init(&surface->stack_link); wl_list_init(&surface->stack_link);
wl_list_init(&surface->parent_link); wl_list_init(&surface->parent_link);
wl_list_init(&surface->unpaired_link); wl_list_init(&surface->unpaired_link);
wl_signal_init(&surface->events.destroy); wl_signal_init(&surface->events.destroy);
wl_signal_init(&surface->events.request_configure); wl_signal_init(&surface->events.request_configure);
wl_signal_init(&surface->events.request_move); wl_signal_init(&surface->events.request_move);
@ -569,6 +570,40 @@ static void xwayland_surface_destroy(struct wlr_xwayland_surface *xsurface) {
wl_signal_emit_mutable(&xsurface->events.destroy, NULL); wl_signal_emit_mutable(&xsurface->events.destroy, NULL);
assert(wl_list_empty(&xsurface->events.destroy.listener_list));
assert(wl_list_empty(&xsurface->events.request_configure.listener_list));
assert(wl_list_empty(&xsurface->events.request_move.listener_list));
assert(wl_list_empty(&xsurface->events.request_resize.listener_list));
assert(wl_list_empty(&xsurface->events.request_minimize.listener_list));
assert(wl_list_empty(&xsurface->events.request_maximize.listener_list));
assert(wl_list_empty(&xsurface->events.request_fullscreen.listener_list));
assert(wl_list_empty(&xsurface->events.request_activate.listener_list));
assert(wl_list_empty(&xsurface->events.request_close.listener_list));
assert(wl_list_empty(&xsurface->events.request_sticky.listener_list));
assert(wl_list_empty(&xsurface->events.request_shaded.listener_list));
assert(wl_list_empty(&xsurface->events.request_skip_taskbar.listener_list));
assert(wl_list_empty(&xsurface->events.request_skip_pager.listener_list));
assert(wl_list_empty(&xsurface->events.request_above.listener_list));
assert(wl_list_empty(&xsurface->events.request_below.listener_list));
assert(wl_list_empty(&xsurface->events.request_demands_attention.listener_list));
assert(wl_list_empty(&xsurface->events.associate.listener_list));
assert(wl_list_empty(&xsurface->events.dissociate.listener_list));
assert(wl_list_empty(&xsurface->events.set_class.listener_list));
assert(wl_list_empty(&xsurface->events.set_role.listener_list));
assert(wl_list_empty(&xsurface->events.set_title.listener_list));
assert(wl_list_empty(&xsurface->events.set_parent.listener_list));
assert(wl_list_empty(&xsurface->events.set_startup_id.listener_list));
assert(wl_list_empty(&xsurface->events.set_window_type.listener_list));
assert(wl_list_empty(&xsurface->events.set_hints.listener_list));
assert(wl_list_empty(&xsurface->events.set_decorations.listener_list));
assert(wl_list_empty(&xsurface->events.set_strut_partial.listener_list));
assert(wl_list_empty(&xsurface->events.set_override_redirect.listener_list));
assert(wl_list_empty(&xsurface->events.set_geometry.listener_list));
assert(wl_list_empty(&xsurface->events.focus_in.listener_list));
assert(wl_list_empty(&xsurface->events.grab_focus.listener_list));
assert(wl_list_empty(&xsurface->events.map_request.listener_list));
assert(wl_list_empty(&xsurface->events.ping_timeout.listener_list));
if (xsurface == xsurface->xwm->focus_surface) { if (xsurface == xsurface->xwm->focus_surface) {
xwm_surface_activate(xsurface->xwm, NULL); xwm_surface_activate(xsurface->xwm, NULL);
} }