diff options
author | Rose Hudson <rose@krx.sh> | 2023-08-22 11:52:45 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-08-22 11:53:28 +0200 |
commit | f5917f0247600b65edec1735234d00de57d577a8 (patch) | |
tree | 24ed46b23632203045c188a8d91dbcaae0acb2c0 /include/wlr | |
parent | 91f813ffb75026baacdccf0f526ba6ee29dcd790 (diff) |
scene_output_layout: make output adding explicit
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3709
Diffstat (limited to 'include/wlr')
-rw-r--r-- | include/wlr/types/wlr_scene.h | 20 |
1 files changed, 15 insertions, 5 deletions
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,15 +517,23 @@ 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. */ |