scene/output-layout: add initial outputs

Kirill Primak 3 years ago committed by Isaac Freund
parent 0c2eed533e
commit 1284f85da4

@ -72,12 +72,8 @@ static void scene_output_layout_handle_layout_change(
} }
} }
static void scene_output_layout_handle_layout_add( static void scene_output_layout_add(struct wlr_scene_output_layout *sol,
struct wl_listener *listener, void *data) { struct wlr_output_layout_output *lo) {
struct wlr_scene_output_layout *sol =
wl_container_of(listener, sol, layout_add);
struct wlr_output_layout_output *lo = data;
struct wlr_scene_output_layout_output *solo = calloc(1, sizeof(*solo)); struct wlr_scene_output_layout_output *solo = calloc(1, sizeof(*solo));
if (solo == NULL) { if (solo == NULL) {
return; return;
@ -105,6 +101,15 @@ static void scene_output_layout_handle_layout_add(
wlr_scene_output_set_position(solo->scene_output, lo->x, lo->y); wlr_scene_output_set_position(solo->scene_output, lo->x, lo->y);
} }
static void scene_output_layout_handle_layout_add(
struct wl_listener *listener, void *data) {
struct wlr_scene_output_layout *sol =
wl_container_of(listener, sol, layout_add);
struct wlr_output_layout_output *lo = data;
scene_output_layout_add(sol, lo);
}
static void scene_output_layout_handle_layout_destroy( static void scene_output_layout_handle_layout_destroy(
struct wl_listener *listener, void *data) { struct wl_listener *listener, void *data) {
struct wlr_scene_output_layout *sol = struct wlr_scene_output_layout *sol =
@ -143,5 +148,10 @@ bool wlr_scene_attach_output_layout(struct wlr_scene *scene,
sol->scene_destroy.notify = scene_output_layout_handle_scene_destroy; sol->scene_destroy.notify = scene_output_layout_handle_scene_destroy;
wl_signal_add(&scene->tree.node.events.destroy, &sol->scene_destroy); wl_signal_add(&scene->tree.node.events.destroy, &sol->scene_destroy);
struct wlr_output_layout_output *lo;
wl_list_for_each(lo, &output_layout->outputs, link) {
scene_output_layout_add(sol, lo);
}
return true; return true;
} }

Loading…
Cancel
Save