|
|
@ -112,6 +112,12 @@ static void wl_output_bind(struct wl_client *wl_client, void *data,
|
|
|
|
wl_output_send_to_resource(wl_resource);
|
|
|
|
wl_output_send_to_resource(wl_resource);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void handle_display_destroy(struct wl_listener *listener, void *data) {
|
|
|
|
|
|
|
|
struct wlr_output *output =
|
|
|
|
|
|
|
|
wl_container_of(listener, output, display_destroy);
|
|
|
|
|
|
|
|
wlr_output_destroy_global(output);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
struct wl_global *wlr_output_create_global(struct wlr_output *wlr_output,
|
|
|
|
struct wl_global *wlr_output_create_global(struct wlr_output *wlr_output,
|
|
|
|
struct wl_display *display) {
|
|
|
|
struct wl_display *display) {
|
|
|
|
if (wlr_output->wl_global != NULL) {
|
|
|
|
if (wlr_output->wl_global != NULL) {
|
|
|
@ -120,6 +126,10 @@ struct wl_global *wlr_output_create_global(struct wlr_output *wlr_output,
|
|
|
|
struct wl_global *wl_global = wl_global_create(display,
|
|
|
|
struct wl_global *wl_global = wl_global_create(display,
|
|
|
|
&wl_output_interface, 3, wlr_output, wl_output_bind);
|
|
|
|
&wl_output_interface, 3, wlr_output, wl_output_bind);
|
|
|
|
wlr_output->wl_global = wl_global;
|
|
|
|
wlr_output->wl_global = wl_global;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wlr_output->display_destroy.notify = handle_display_destroy;
|
|
|
|
|
|
|
|
wl_display_add_destroy_listener(display, &wlr_output->display_destroy);
|
|
|
|
|
|
|
|
|
|
|
|
return wl_global;
|
|
|
|
return wl_global;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -127,6 +137,7 @@ void wlr_output_destroy_global(struct wlr_output *wlr_output) {
|
|
|
|
if (wlr_output->wl_global == NULL) {
|
|
|
|
if (wlr_output->wl_global == NULL) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
wl_list_remove(&wlr_output->display_destroy.link);
|
|
|
|
struct wl_resource *resource, *tmp;
|
|
|
|
struct wl_resource *resource, *tmp;
|
|
|
|
wl_resource_for_each_safe(resource, tmp, &wlr_output->wl_resources) {
|
|
|
|
wl_resource_for_each_safe(resource, tmp, &wlr_output->wl_resources) {
|
|
|
|
struct wl_list *link = wl_resource_get_link(resource);
|
|
|
|
struct wl_list *link = wl_resource_get_link(resource);
|
|
|
|