mirror of
https://github.com/cage-kiosk/cage.git
synced 2025-10-29 05:40:19 -04:00
output: Call wlr_scene_output_create
This commit is contained in:
parent
64e2a44124
commit
b772a00df8
1 changed files with 8 additions and 5 deletions
13
output.c
13
output.c
|
|
@ -70,24 +70,21 @@ update_output_manager_config(struct cg_server *server)
|
|||
static inline void
|
||||
output_layout_add_auto(struct cg_output *output)
|
||||
{
|
||||
wlr_output_layout_add_auto(output->server->output_layout, output->wlr_output);
|
||||
output->scene_output = wlr_scene_get_scene_output(output->server->scene, output->wlr_output);
|
||||
assert(output->scene_output != NULL);
|
||||
wlr_output_layout_add_auto(output->server->output_layout, output->wlr_output);
|
||||
}
|
||||
|
||||
static inline void
|
||||
output_layout_add(struct cg_output *output, int32_t x, int32_t y)
|
||||
{
|
||||
wlr_output_layout_add(output->server->output_layout, output->wlr_output, x, y);
|
||||
output->scene_output = wlr_scene_get_scene_output(output->server->scene, output->wlr_output);
|
||||
assert(output->scene_output != NULL);
|
||||
wlr_output_layout_add(output->server->output_layout, output->wlr_output, x, y);
|
||||
}
|
||||
|
||||
static inline void
|
||||
output_layout_remove(struct cg_output *output)
|
||||
{
|
||||
wlr_output_layout_remove(output->server->output_layout, output->wlr_output);
|
||||
output->scene_output = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -296,6 +293,12 @@ handle_new_output(struct wl_listener *listener, void *data)
|
|||
output->frame.notify = handle_output_frame;
|
||||
wl_signal_add(&wlr_output->events.frame, &output->frame);
|
||||
|
||||
output->scene_output = wlr_scene_output_create(server->scene, wlr_output);
|
||||
if (!output->scene_output) {
|
||||
wlr_log(WLR_ERROR, "Failed to allocate scene output");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!wl_list_empty(&wlr_output->modes)) {
|
||||
/* Ensure the output is marked as enabled before trying to set mode */
|
||||
wlr_output_enable(wlr_output, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue