mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-28 05:40:11 -04:00
Add missing destroy events on automatically destroyed objects
This commit is contained in:
parent
3e651b4642
commit
c0d4d7217b
10 changed files with 21 additions and 1 deletions
|
|
@ -20,6 +20,8 @@ struct wlr_drm_lease_v1_manager {
|
|||
struct wl_display *display;
|
||||
|
||||
struct {
|
||||
struct wl_signal destroy;
|
||||
|
||||
/**
|
||||
* Upon receiving this signal, call
|
||||
* wlr_drm_lease_device_v1_grant_lease_request() to grant a lease of the
|
||||
|
|
|
|||
|
|
@ -78,6 +78,8 @@ struct wlr_pointer_constraints_v1 {
|
|||
struct wl_list constraints; // wlr_pointer_constraint_v1.link
|
||||
|
||||
struct {
|
||||
struct wl_signal destroy;
|
||||
|
||||
/**
|
||||
* Called when a new pointer constraint is created.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ struct wlr_transient_seat_manager_v1 {
|
|||
struct wl_global *global;
|
||||
|
||||
struct {
|
||||
struct wl_signal destroy;
|
||||
|
||||
/**
|
||||
* Upon receiving this signal, call
|
||||
* wlr_transient_seat_v1_ready() to pass a newly created seat
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ struct wlr_xdg_system_bell_v1 {
|
|||
struct wl_global *global;
|
||||
|
||||
struct {
|
||||
struct wl_signal destroy;
|
||||
struct wl_signal ring; // struct wlr_xdg_system_bell_v1_ring_event
|
||||
} events;
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ struct wlr_xwayland {
|
|||
struct wlr_seat *seat;
|
||||
|
||||
struct {
|
||||
struct wl_signal destroy;
|
||||
struct wl_signal ready;
|
||||
struct wl_signal new_surface; // struct wlr_xwayland_surface
|
||||
struct wl_signal remove_startup_info; // struct wlr_xwayland_remove_startup_info_event
|
||||
|
|
|
|||
|
|
@ -682,6 +682,8 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
|
|||
display_destroy);
|
||||
wlr_log(WLR_DEBUG, "Destroying wlr_drm_lease_v1_manager");
|
||||
|
||||
wl_signal_emit_mutable(&manager->events.destroy, NULL);
|
||||
|
||||
struct wlr_drm_lease_device_v1 *device, *tmp;
|
||||
wl_list_for_each_safe(device, tmp, &manager->devices, link) {
|
||||
drm_lease_device_v1_destroy(device);
|
||||
|
|
@ -718,6 +720,7 @@ struct wlr_drm_lease_v1_manager *wlr_drm_lease_v1_manager_create(
|
|||
manager->display_destroy.notify = handle_display_destroy;
|
||||
wl_display_add_destroy_listener(display, &manager->display_destroy);
|
||||
|
||||
wl_signal_init(&manager->events.destroy);
|
||||
wl_signal_init(&manager->events.request);
|
||||
|
||||
return manager;
|
||||
|
|
|
|||
|
|
@ -322,6 +322,7 @@ static void pointer_constraints_bind(struct wl_client *client, void *data,
|
|||
static void handle_display_destroy(struct wl_listener *listener, void *data) {
|
||||
struct wlr_pointer_constraints_v1 *pointer_constraints =
|
||||
wl_container_of(listener, pointer_constraints, display_destroy);
|
||||
wl_signal_emit_mutable(&pointer_constraints->events.destroy, NULL);
|
||||
wl_list_remove(&pointer_constraints->display_destroy.link);
|
||||
wl_global_destroy(pointer_constraints->global);
|
||||
free(pointer_constraints);
|
||||
|
|
@ -345,6 +346,8 @@ struct wlr_pointer_constraints_v1 *wlr_pointer_constraints_v1_create(
|
|||
pointer_constraints->global = wl_global;
|
||||
|
||||
wl_list_init(&pointer_constraints->constraints);
|
||||
|
||||
wl_signal_init(&pointer_constraints->events.destroy);
|
||||
wl_signal_init(&pointer_constraints->events.new_constraint);
|
||||
|
||||
pointer_constraints->display_destroy.notify = handle_display_destroy;
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ static const struct ext_transient_seat_manager_v1_interface manager_impl = {
|
|||
static void handle_display_destroy(struct wl_listener *listener, void *data) {
|
||||
struct wlr_transient_seat_manager_v1 *manager =
|
||||
wl_container_of(listener, manager, display_destroy);
|
||||
|
||||
wl_signal_emit_mutable(&manager->events.destroy, NULL);
|
||||
wl_list_remove(&manager->display_destroy.link);
|
||||
wl_global_destroy(manager->global);
|
||||
free(manager);
|
||||
|
|
@ -154,6 +154,7 @@ struct wlr_transient_seat_manager_v1 *wlr_transient_seat_manager_v1_create(
|
|||
manager->display_destroy.notify = handle_display_destroy;
|
||||
wl_display_add_destroy_listener(display, &manager->display_destroy);
|
||||
|
||||
wl_signal_init(&manager->events.destroy);
|
||||
wl_signal_init(&manager->events.create_seat);
|
||||
|
||||
return manager;
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ static void bell_bind(struct wl_client *client, 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);
|
||||
wl_signal_emit_mutable(&bell->events.destroy, NULL);
|
||||
wl_list_remove(&bell->display_destroy.link);
|
||||
wl_global_destroy(bell->global);
|
||||
free(bell);
|
||||
|
|
@ -75,6 +76,7 @@ struct wlr_xdg_system_bell_v1 *wlr_xdg_system_bell_v1_create(struct wl_display *
|
|||
bell->display_destroy.notify = handle_display_destroy;
|
||||
wl_display_add_destroy_listener(display, &bell->display_destroy);
|
||||
|
||||
wl_signal_init(&bell->events.destroy);
|
||||
wl_signal_init(&bell->events.ring);
|
||||
|
||||
return bell;
|
||||
|
|
|
|||
|
|
@ -79,6 +79,8 @@ void wlr_xwayland_destroy(struct wlr_xwayland *xwayland) {
|
|||
return;
|
||||
}
|
||||
|
||||
wl_signal_emit_mutable(&xwayland->events.destroy, NULL);
|
||||
|
||||
wl_list_remove(&xwayland->server_destroy.link);
|
||||
wl_list_remove(&xwayland->server_start.link);
|
||||
wl_list_remove(&xwayland->server_ready.link);
|
||||
|
|
@ -105,6 +107,7 @@ struct wlr_xwayland *wlr_xwayland_create_with_server(struct wl_display *wl_displ
|
|||
xwayland->wl_display = wl_display;
|
||||
xwayland->compositor = compositor;
|
||||
|
||||
wl_signal_init(&xwayland->events.destroy);
|
||||
wl_signal_init(&xwayland->events.new_surface);
|
||||
wl_signal_init(&xwayland->events.ready);
|
||||
wl_signal_init(&xwayland->events.remove_startup_info);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue