From f5917f0247600b65edec1735234d00de57d577a8 Mon Sep 17 00:00:00 2001 From: Rose Hudson Date: Tue, 22 Aug 2023 11:52:45 +0200 Subject: scene_output_layout: make output adding explicit Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3709 --- include/wlr/types/wlr_scene.h | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/wlr/types/wlr_scene.h b/include/wlr/types/wlr_scene.h index 2dd9401f..3af839ab 100644 --- a/include/wlr/types/wlr_scene.h +++ b/include/wlr/types/wlr_scene.h @@ -30,6 +30,7 @@ struct wlr_output; struct wlr_output_layout; +struct wlr_output_layout_output; struct wlr_xdg_surface; struct wlr_layer_surface_v1; struct wlr_drag_icon; @@ -37,6 +38,7 @@ struct wlr_surface; struct wlr_scene_node; struct wlr_scene_buffer; +struct wlr_scene_output_layout; struct wlr_presentation; struct wlr_linux_dmabuf_v1; @@ -515,14 +517,22 @@ struct wlr_scene_output *wlr_scene_get_scene_output(struct wlr_scene *scene, /** * Attach an output layout to a scene. * - * Adding, removing, or repositioning an output in the output layout - * will respectively add, remove or reposition a corresponding - * scene-graph output. When the output layout is destroyed, scene-graph - * outputs which were created by this helper will be destroyed. + * With an attached `wlr_scene_output_layout`, removing or repositioning an output in the output + * layout will respectively remove or reposition a corresponding scene-graph output. When the output + * layout is destroyed, scene-graph outputs which were attached to this helper will be destroyed. + * + * When adding an output to the output_layout, users must also create a `wlr_scene_output` and pass + * it to wlr_scene_output_layout_add_output(). */ -bool wlr_scene_attach_output_layout(struct wlr_scene *scene, +struct wlr_scene_output_layout *wlr_scene_attach_output_layout(struct wlr_scene *scene, struct wlr_output_layout *output_layout); +/** + * Add an output to the scene, with its positioning defined by the output layout. + */ +void wlr_scene_output_layout_add_output(struct wlr_scene_output_layout *sol, + struct wlr_output_layout_output *lo, struct wlr_scene_output *so); + /** * Add a node displaying a surface and all of its sub-surfaces to the * scene-graph. -- cgit v1.2.3