diff options
author | Alexander Orzechowski <alex@ozal.ski> | 2024-01-18 10:00:45 -0500 |
---|---|---|
committer | Kirill Primak <vyivel@eclair.cafe> | 2024-01-18 18:36:54 +0300 |
commit | 1eb16d136774c8fb3c9085df45156264f0db8814 (patch) | |
tree | 9c348ab37edae50b76a388d7e8d8dcd011cea33b /sway/desktop/output.c | |
parent | dbd2fbf4301d441be4f9a04a1df6d93c81c361f6 (diff) |
scene_graph: Maintain `wlr_scene_node`s for the sway tree.
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r-- | sway/desktop/output.c | 18 |
1 files changed, 15 insertions, 3 deletions
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); |