|
|
@ -9,17 +9,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
static const struct wlr_addon_interface addon_impl;
|
|
|
|
static const struct wlr_addon_interface addon_impl;
|
|
|
|
|
|
|
|
|
|
|
|
struct wlr_output_layout *wlr_output_layout_create(void) {
|
|
|
|
static void output_layout_handle_display_destroy(struct wl_listener *listener,
|
|
|
|
|
|
|
|
void *data) {
|
|
|
|
|
|
|
|
struct wlr_output_layout *layout = wl_container_of(listener, layout, display_destroy);
|
|
|
|
|
|
|
|
wlr_output_layout_destroy(layout);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct wlr_output_layout *wlr_output_layout_create(struct wl_display *display) {
|
|
|
|
struct wlr_output_layout *layout = calloc(1, sizeof(*layout));
|
|
|
|
struct wlr_output_layout *layout = calloc(1, sizeof(*layout));
|
|
|
|
if (layout == NULL) {
|
|
|
|
if (layout == NULL) {
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
wl_list_init(&layout->outputs);
|
|
|
|
wl_list_init(&layout->outputs);
|
|
|
|
|
|
|
|
layout->display = display;
|
|
|
|
|
|
|
|
|
|
|
|
wl_signal_init(&layout->events.add);
|
|
|
|
wl_signal_init(&layout->events.add);
|
|
|
|
wl_signal_init(&layout->events.change);
|
|
|
|
wl_signal_init(&layout->events.change);
|
|
|
|
wl_signal_init(&layout->events.destroy);
|
|
|
|
wl_signal_init(&layout->events.destroy);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
layout->display_destroy.notify = output_layout_handle_display_destroy;
|
|
|
|
|
|
|
|
wl_display_add_destroy_listener(display, &layout->display_destroy);
|
|
|
|
|
|
|
|
|
|
|
|
return layout;
|
|
|
|
return layout;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -45,6 +55,7 @@ void wlr_output_layout_destroy(struct wlr_output_layout *layout) {
|
|
|
|
output_layout_output_destroy(l_output);
|
|
|
|
output_layout_output_destroy(l_output);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wl_list_remove(&layout->display_destroy.link);
|
|
|
|
free(layout);
|
|
|
|
free(layout);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|