output: take wl_display in wlr_output_create_global()

Currently wlr_output holds a wl_display, but it will go away soon.
Instead of relying on that field in wlr_output_create_global(),
make the dependency explicit by taking a wl_display as argument.
This commit is contained in:
Simon Ser 2023-08-12 08:24:59 +02:00 committed by Isaac Freund
parent 6a7463bb8e
commit 5717e27c06
6 changed files with 11 additions and 10 deletions

View file

@ -128,11 +128,11 @@ static void output_bind(struct wl_client *wl_client, void *data,
wl_signal_emit_mutable(&output->events.bind, &evt);
}
void wlr_output_create_global(struct wlr_output *output) {
void wlr_output_create_global(struct wlr_output *output, struct wl_display *display) {
if (output->global != NULL) {
return;
}
output->global = wl_global_create(output->display,
output->global = wl_global_create(display,
&wl_output_interface, OUTPUT_VERSION, output, output_bind);
if (output->global == NULL) {
wlr_log(WLR_ERROR, "Failed to allocate wl_output global");