wlr_outputs: add wlr_addon_set

This commit is contained in:
Kirill Primak 2021-08-09 20:18:31 +03:00 committed by Simon Ser
parent a6a80850b7
commit 11f799e88e
2 changed files with 6 additions and 0 deletions

View File

@ -16,6 +16,7 @@
#include <wayland-util.h> #include <wayland-util.h>
#include <wlr/render/dmabuf.h> #include <wlr/render/dmabuf.h>
#include <wlr/types/wlr_buffer.h> #include <wlr/types/wlr_buffer.h>
#include <wlr/util/addon.h>
struct wlr_output_mode { struct wlr_output_mode {
int32_t width, height; int32_t width, height;
@ -184,6 +185,8 @@ struct wlr_output {
struct wl_listener display_destroy; struct wl_listener display_destroy;
struct wlr_addon_set addons;
void *data; void *data;
}; };

View File

@ -376,6 +376,8 @@ void wlr_output_init(struct wlr_output *output, struct wlr_backend *backend,
output->software_cursor_locks = 1; output->software_cursor_locks = 1;
} }
wlr_addon_set_init(&output->addons);
output->display_destroy.notify = handle_display_destroy; output->display_destroy.notify = handle_display_destroy;
wl_display_add_destroy_listener(display, &output->display_destroy); wl_display_add_destroy_listener(display, &output->display_destroy);
} }
@ -395,6 +397,7 @@ void wlr_output_destroy(struct wlr_output *output) {
output_clear_back_buffer(output); output_clear_back_buffer(output);
wlr_signal_emit_safe(&output->events.destroy, output); wlr_signal_emit_safe(&output->events.destroy, output);
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