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 --- tinywl/tinywl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tinywl') diff --git a/tinywl/tinywl.c b/tinywl/tinywl.c index e91ad283..67d2be77 100644 --- a/tinywl/tinywl.c +++ b/tinywl/tinywl.c @@ -39,6 +39,7 @@ struct tinywl_server { struct wlr_renderer *renderer; struct wlr_allocator *allocator; struct wlr_scene *scene; + struct wlr_scene_output_layout *scene_layout; struct wlr_xdg_shell *xdg_shell; struct wl_listener new_xdg_surface; @@ -646,7 +647,10 @@ static void server_new_output(struct wl_listener *listener, void *data) { * display, which Wayland clients can see to find out information about the * output (such as DPI, scale factor, manufacturer, etc). */ - wlr_output_layout_add_auto(server->output_layout, wlr_output); + struct wlr_output_layout_output *l_output = wlr_output_layout_add_auto(server->output_layout, + wlr_output); + struct wlr_scene_output *scene_output = wlr_scene_output_create(server->scene, wlr_output); + wlr_scene_output_layout_add_output(server->scene_layout, l_output, scene_output); } static void xdg_toplevel_map(struct wl_listener *listener, void *data) { @@ -906,7 +910,7 @@ int main(int argc, char *argv[]) { * necessary. */ server.scene = wlr_scene_create(); - wlr_scene_attach_output_layout(server.scene, server.output_layout); + server.scene_layout = wlr_scene_attach_output_layout(server.scene, server.output_layout); /* Set up xdg-shell version 3. The xdg-shell is a Wayland protocol which is * used for application windows. For more detail on shells, refer to my -- cgit v1.2.3