scene_output_layout: make output adding explicit

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3709
This commit is contained in:
Rose Hudson 2023-08-22 11:52:45 +02:00 committed by Simon Ser
parent 91f813ffb7
commit f5917f0247
3 changed files with 27 additions and 37 deletions

View file

@ -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.