From 2d14d1eaa4c2a3240dedf7b880a298a75170ce9d Mon Sep 17 00:00:00 2001 From: William McKinnon Date: Tue, 30 May 2023 00:16:34 -0400 Subject: [PATCH] fixed fade in for children cons --- sway/desktop/output.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 86079a13..e7b27864 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -527,14 +527,16 @@ static void containers_tick_alpha(list_t *containers, struct sway_output *output const long NSEC_IN_SECONDS = 1000000000; float output_refresh_seconds = (float)output->refresh_nsec / NSEC_IN_SECONDS; - float num_refreshes = animation_duration / output_refresh_seconds; + float num_refreshes_to_animate = animation_duration / output_refresh_seconds; float alpha_step; for (int i = 0; i < containers->length; ++i) { struct sway_container *con = containers->items[i]; - if (con->alpha < con->target_alpha) { - alpha_step = (con->target_alpha) / num_refreshes; - // ensure that the current alpha does not exceed the set alpha for the con + if (con->pending.children) { + containers_tick_alpha(con->pending.children, output); + } else if (con->alpha < con->target_alpha) { + alpha_step = (con->target_alpha) / num_refreshes_to_animate; + // ensure that the alpha does not exceed the target_alpha con->alpha = MIN(con->alpha + alpha_step, con->target_alpha); output_damage_whole_container(output, con); } @@ -588,11 +590,11 @@ static int output_repaint_timer_handler(void *data) { return 0; } + containers_tick_alpha(workspace->current.tiling, output); + pixman_region32_t damage; pixman_region32_init(&damage); - containers_tick_alpha(workspace->current.tiling, output); - wlr_damage_ring_get_buffer_damage(&output->damage_ring, buffer_age, &damage); if (!output->wlr_output->needs_frame && !pixman_region32_not_empty(&output->damage_ring.current)) {