diff options
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r-- | sway/desktop/output.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 45c2f1c4..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); } @@ -745,12 +755,14 @@ 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; + // 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, - .y = con->current.y - output->ly - 1, - .width = con->current.width + 2, - .height = con->current.height + 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)) { @@ -973,7 +985,6 @@ void handle_new_output(struct wl_listener *listener, void *data) { transaction_commit_dirty(); - // From sway upstream (fixes damage_ring bounds being INT_MAX) int width, height; wlr_output_transformed_resolution(output->wlr_output, &width, &height); wlr_damage_ring_set_bounds(&output->damage_ring, width, height); |