From 1d423cd56a868c1f0470d6ef82b07ddf2a64ee51 Mon Sep 17 00:00:00 2001 From: Stuart Dilts Date: Sun, 7 Apr 2024 14:08:20 -0600 Subject: [PATCH] Cleanup output listeners correctly + Remove unused `mode` listener + Unlink the destroy and request state listeners --- heart/include/hrt/hrt_output.h | 1 - heart/src/output.c | 3 ++- lisp/bindings/hrt-bindings.lisp | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/heart/include/hrt/hrt_output.h b/heart/include/hrt/hrt_output.h index d386265..cfa9389 100644 --- a/heart/include/hrt/hrt_output.h +++ b/heart/include/hrt/hrt_output.h @@ -14,7 +14,6 @@ struct hrt_output { struct wl_listener request_state; struct wl_listener frame; struct wl_listener destroy; - struct wl_listener mode; // temp background color float color[4]; diff --git a/heart/src/output.c b/heart/src/output.c index 5eb1162..0acfdfc 100644 --- a/heart/src/output.c +++ b/heart/src/output.c @@ -36,6 +36,8 @@ static void handle_output_destroy(struct wl_listener *listener, void *data) { server->output_callback->output_removed(output); wl_list_remove(&output->frame.link); + wl_list_remove(&output->request_state.link); + wl_list_remove(&output->destroy.link); // wlr_output_layout removes the output by itself. @@ -123,7 +125,6 @@ bool hrt_output_init(struct hrt_server *server, const struct hrt_output_callback server->output_layout = wlr_output_layout_create(); server->scene = wlr_scene_create(); server->scene_layout = wlr_scene_attach_output_layout(server->scene, server->output_layout); - wlr_scene_attach_output_layout(server->scene, server->output_layout); server->output_manager = wlr_output_manager_v1_create(server->wl_display); diff --git a/lisp/bindings/hrt-bindings.lisp b/lisp/bindings/hrt-bindings.lisp index 0775e7b..b6b6a78 100644 --- a/lisp/bindings/hrt-bindings.lisp +++ b/lisp/bindings/hrt-bindings.lisp @@ -108,7 +108,6 @@ See themes section of man xcursor(3) to find where to find valid cursor names." (request-state (:struct wl-listener)) (frame (:struct wl-listener)) (destroy (:struct wl-listener)) - (mode (:struct wl-listener)) (color :float :count 4)) (cffi:defcstruct hrt-output-callbacks