mirror of
https://github.com/cage-kiosk/cage.git
synced 2025-10-29 05:40:19 -04:00
Use wlr_scene_attach_output_layout
This provides wlr_output_layout integration. References: https://github.com/swaywm/wlroots/pull/3160
This commit is contained in:
parent
d46e8a82dd
commit
0736d72e88
2 changed files with 14 additions and 1 deletions
2
cage.c
2
cage.c
|
|
@ -338,6 +338,8 @@ main(int argc, char *argv[])
|
|||
goto end;
|
||||
}
|
||||
|
||||
wlr_scene_attach_output_layout(server.scene, server.output_layout);
|
||||
|
||||
compositor = wlr_compositor_create(server.wl_display, server.renderer);
|
||||
if (!compositor) {
|
||||
wlr_log(WLR_ERROR, "Unable to create the wlroots compositor");
|
||||
|
|
|
|||
13
output.c
13
output.c
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <wayland-server-core.h>
|
||||
|
|
@ -206,6 +207,15 @@ output_enable(struct cg_output *output)
|
|||
wlr_output_layout_add_auto(output->server->output_layout, wlr_output);
|
||||
wlr_output_enable(wlr_output, true);
|
||||
wlr_output_commit(wlr_output);
|
||||
|
||||
struct wlr_scene_output *scene_output;
|
||||
wl_list_for_each (scene_output, &output->server->scene->outputs, link) {
|
||||
if (scene_output->output == wlr_output) {
|
||||
output->scene_output = scene_output;
|
||||
break;
|
||||
}
|
||||
}
|
||||
assert(output->scene_output != NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -218,6 +228,8 @@ output_disable(struct cg_output *output)
|
|||
return;
|
||||
}
|
||||
|
||||
output->scene_output = NULL;
|
||||
|
||||
wlr_log(WLR_DEBUG, "Disabling output %s", wlr_output->name);
|
||||
wlr_output_enable(wlr_output, false);
|
||||
wlr_output_layout_remove(output->server->output_layout, wlr_output);
|
||||
|
|
@ -343,7 +355,6 @@ handle_new_output(struct wl_listener *listener, void *data)
|
|||
|
||||
output->wlr_output = wlr_output;
|
||||
output->server = server;
|
||||
output->scene_output = wlr_scene_output_create(server->scene, wlr_output);
|
||||
|
||||
wl_list_insert(&server->outputs, &output->link);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue