From e6d1ee8b4d59a249c8e363e8de1490ed86c7d983 Mon Sep 17 00:00:00 2001 From: William McKinnon Date: Sun, 14 May 2023 21:03:58 -0400 Subject: [PATCH] moved blur damage to damage_surface_iterator --- sway/desktop/output.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 3b4a5303..45bbf0b8 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -689,6 +689,16 @@ static void damage_surface_iterator(struct sway_output *output, ceil(output->wlr_output->scale) - surface->current.scale); } pixman_region32_translate(&damage, box.x, box.y); + + if (view) { + int blur_size = view->container->blur_enabled ? config_get_blur_size() : 0; + wlr_region_expand(&damage, &damage, blur_size); + box.x -= blur_size; + box.y -= blur_size; + box.width += blur_size * 2; + box.height += blur_size * 2; + } + if (wlr_damage_ring_add(&output->damage_ring, &damage)) { wlr_output_schedule_frame(output->wlr_output); } @@ -746,15 +756,13 @@ static void damage_child_views_iterator(struct sway_container *con, void output_damage_whole_container(struct sway_output *output, struct sway_container *con) { int shadow_sigma = con->shadow_enabled ? config->shadow_blur_sigma : 0; - int blur_size = con->blur_enabled ? config_get_blur_size() : 0; - int effect_size = MAX(shadow_sigma, blur_size); // Pad the box by 1px, because the width is a double and might be a fraction struct wlr_box box = { - .x = con->current.x - output->lx - 1 - effect_size, - .y = con->current.y - output->ly - 1 - effect_size, - .width = con->current.width + 2 + effect_size * 2, - .height = con->current.height + 2 + effect_size * 2, + .x = con->current.x - output->lx - 1 - shadow_sigma, + .y = con->current.y - output->ly - 1 - shadow_sigma, + .width = con->current.width + 2 + shadow_sigma * 2, + .height = con->current.height + 2 + shadow_sigma * 2, }; scale_box(&box, output->wlr_output->scale); if (wlr_damage_ring_add_box(&output->damage_ring, &box)) {