aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
authorLibravatar Alexander Orzechowski <alex@ozal.ski>2024-01-18 10:00:45 -0500
committerLibravatar Kirill Primak <vyivel@eclair.cafe>2024-01-18 18:36:54 +0300
commit1eb16d136774c8fb3c9085df45156264f0db8814 (patch)
tree9c348ab37edae50b76a388d7e8d8dcd011cea33b /sway/desktop/output.c
parentview: init function should return a success bool (diff)
downloadsway-1eb16d136774c8fb3c9085df45156264f0db8814.tar.gz
sway-1eb16d136774c8fb3c9085df45156264f0db8814.tar.zst
sway-1eb16d136774c8fb3c9085df45156264f0db8814.zip
scene_graph: Maintain `wlr_scene_node`s for the sway tree.
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r--sway/desktop/output.c18
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,
856 .height = con->current.height + 2, 856 .height = con->current.height + 2,
857 }; 857 };
858 scale_box(&box, output->wlr_output->scale); 858 scale_box(&box, output->wlr_output->scale);
859 if (wlr_damage_ring_add_box(&output->damage_ring, &box)) {
860 wlr_output_schedule_frame(output->wlr_output);
861 }
862 // Damage subsurfaces as well, which may extend outside the box 859 // Damage subsurfaces as well, which may extend outside the box
863 if (con->view) { 860 if (con->view) {
864 damage_child_views_iterator(con, output); 861 damage_child_views_iterator(con, output);
@@ -914,6 +911,8 @@ static void begin_destroy(struct sway_output *output) {
914 911
915 wlr_damage_ring_finish(&output->damage_ring); 912 wlr_damage_ring_finish(&output->damage_ring);
916 913
914 wlr_scene_output_destroy(output->scene_output);
915 output->scene_output = NULL;
917 output->wlr_output->data = NULL; 916 output->wlr_output->data = NULL;
918 output->wlr_output = NULL; 917 output->wlr_output = NULL;
919 918
@@ -1039,11 +1038,24 @@ void handle_new_output(struct wl_listener *listener, void *data) {
1039 return; 1038 return;
1040 } 1039 }
1041 1040
1041 // Create the scene output here so we're not accidentally creating one for
1042 // the fallback output
1043 struct wlr_scene_output *scene_output =
1044 wlr_scene_output_create(root->root_scene, wlr_output);
1045 if (!scene_output) {
1046 sway_log(SWAY_ERROR, "Failed to create a scene output");
1047 return;
1048 }
1049
1042 struct sway_output *output = output_create(wlr_output); 1050 struct sway_output *output = output_create(wlr_output);
1043 if (!output) { 1051 if (!output) {
1052 sway_log(SWAY_ERROR, "Failed to create a sway output");
1053 wlr_scene_output_destroy(scene_output);
1044 return; 1054 return;
1045 } 1055 }
1056
1046 output->server = server; 1057 output->server = server;
1058 output->scene_output = scene_output;
1047 wlr_damage_ring_init(&output->damage_ring); 1059 wlr_damage_ring_init(&output->damage_ring);
1048 1060
1049 wl_signal_add(&root->output_layout->events.destroy, &output->layout_destroy); 1061 wl_signal_add(&root->output_layout->events.destroy, &output->layout_destroy);