aboutsummaryrefslogtreecommitdiff
path: root/tinywl
diff options
context:
space:
mode:
authorRose Hudson <rose@krx.sh>2023-08-22 11:52:45 +0200
committerSimon Ser <contact@emersion.fr>2023-08-22 11:53:28 +0200
commitf5917f0247600b65edec1735234d00de57d577a8 (patch)
tree24ed46b23632203045c188a8d91dbcaae0acb2c0 /tinywl
parent91f813ffb75026baacdccf0f526ba6ee29dcd790 (diff)
scene_output_layout: make output adding explicit
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3709
Diffstat (limited to 'tinywl')
-rw-r--r--tinywl/tinywl.c8
1 files changed, 6 insertions, 2 deletions
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