xdg-dialog: add missing wm destroy signal

This commit is contained in:
Kirill Primak 2025-01-08 19:29:19 +03:00
parent bcf8e467db
commit b03b05d2b3
2 changed files with 4 additions and 0 deletions

View file

@ -35,6 +35,7 @@ struct wlr_xdg_wm_dialog_v1 {
struct wl_global *global;
struct {
struct wl_signal destroy;
struct wl_signal new_dialog; // struct wlr_xdg_dialog_v1
} events;

View file

@ -152,6 +152,8 @@ static void wm_bind(struct wl_client *client, void *data, uint32_t version, uint
static void xdg_wm_dialog_handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_xdg_wm_dialog_v1 *wm = wl_container_of(listener, wm, display_destroy);
wl_signal_emit_mutable(&wm->events.destroy, NULL);
wl_list_remove(&wm->display_destroy.link);
wl_global_destroy(wm->global);
free(wm);
@ -186,6 +188,7 @@ struct wlr_xdg_wm_dialog_v1 *wlr_xdg_wm_dialog_v1_create(struct wl_display *disp
wm->display_destroy.notify = xdg_wm_dialog_handle_display_destroy;
wl_display_add_destroy_listener(display, &wm->display_destroy);
wl_signal_init(&wm->events.destroy);
wl_signal_init(&wm->events.new_dialog);
return wm;