aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--types/scene/output_layout.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/types/scene/output_layout.c b/types/scene/output_layout.c
index 21223114..900cabc3 100644
--- a/types/scene/output_layout.c
+++ b/types/scene/output_layout.c
@@ -72,12 +72,8 @@ static void scene_output_layout_handle_layout_change(
}
}
-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;
-
+static void scene_output_layout_add(struct wlr_scene_output_layout *sol,
+ struct wlr_output_layout_output *lo) {
struct wlr_scene_output_layout_output *solo = calloc(1, sizeof(*solo));
if (solo == NULL) {
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);
}
+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(
struct wl_listener *listener, void *data) {
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;
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;
}