From 1eb16d136774c8fb3c9085df45156264f0db8814 Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Thu, 18 Jan 2024 10:00:45 -0500 Subject: scene_graph: Maintain `wlr_scene_node`s for the sway tree. --- sway/desktop/output.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'sway/desktop/output.c') diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 928c77d6..288ccc7c 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -856,9 +856,6 @@ void output_damage_whole_container(struct sway_output *output, .height = con->current.height + 2, }; scale_box(&box, output->wlr_output->scale); - if (wlr_damage_ring_add_box(&output->damage_ring, &box)) { - wlr_output_schedule_frame(output->wlr_output); - } // Damage subsurfaces as well, which may extend outside the box if (con->view) { damage_child_views_iterator(con, output); @@ -914,6 +911,8 @@ static void begin_destroy(struct sway_output *output) { wlr_damage_ring_finish(&output->damage_ring); + wlr_scene_output_destroy(output->scene_output); + output->scene_output = NULL; output->wlr_output->data = NULL; output->wlr_output = NULL; @@ -1039,11 +1038,24 @@ void handle_new_output(struct wl_listener *listener, void *data) { return; } + // Create the scene output here so we're not accidentally creating one for + // the fallback output + struct wlr_scene_output *scene_output = + wlr_scene_output_create(root->root_scene, wlr_output); + if (!scene_output) { + sway_log(SWAY_ERROR, "Failed to create a scene output"); + return; + } + struct sway_output *output = output_create(wlr_output); if (!output) { + sway_log(SWAY_ERROR, "Failed to create a sway output"); + wlr_scene_output_destroy(scene_output); return; } + output->server = server; + output->scene_output = scene_output; wlr_damage_ring_init(&output->damage_ring); wl_signal_add(&root->output_layout->events.destroy, &output->layout_destroy); -- cgit v1.2.3