output: Call wlr_scene_output_create

This commit is contained in:
Kenny Levinsen 2023-09-30 13:38:29 +02:00 committed by Simon Ser
parent 64e2a44124
commit b772a00df8

View file

@ -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);