diff options
-rw-r--r-- | sway/desktop/output.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index ed6bc064..e0d76349 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -633,21 +633,19 @@ static void damage_surface_iterator(struct sway_output *output, | |||
633 | struct wlr_box box = *_box; | 633 | struct wlr_box box = *_box; |
634 | scale_box(&box, output->wlr_output->scale); | 634 | scale_box(&box, output->wlr_output->scale); |
635 | 635 | ||
636 | if (pixman_region32_not_empty(&surface->buffer_damage)) { | 636 | pixman_region32_t damage; |
637 | pixman_region32_t damage; | 637 | pixman_region32_init(&damage); |
638 | pixman_region32_init(&damage); | 638 | wlr_surface_get_effective_damage(surface, &damage); |
639 | wlr_surface_get_effective_damage(surface, &damage); | 639 | wlr_region_scale(&damage, &damage, output->wlr_output->scale); |
640 | wlr_region_scale(&damage, &damage, output->wlr_output->scale); | 640 | if (ceil(output->wlr_output->scale) > surface->current.scale) { |
641 | if (ceil(output->wlr_output->scale) > surface->current.scale) { | 641 | // When scaling up a surface, it'll become blurry so we need to |
642 | // When scaling up a surface, it'll become blurry so we need to | 642 | // expand the damage region |
643 | // expand the damage region | 643 | wlr_region_expand(&damage, &damage, |
644 | wlr_region_expand(&damage, &damage, | 644 | ceil(output->wlr_output->scale) - surface->current.scale); |
645 | ceil(output->wlr_output->scale) - surface->current.scale); | 645 | } |
646 | } | 646 | pixman_region32_translate(&damage, box.x, box.y); |
647 | pixman_region32_translate(&damage, box.x, box.y); | 647 | wlr_output_damage_add(output->damage, &damage); |
648 | wlr_output_damage_add(output->damage, &damage); | 648 | pixman_region32_fini(&damage); |
649 | pixman_region32_fini(&damage); | ||
650 | } | ||
651 | 649 | ||
652 | if (whole) { | 650 | if (whole) { |
653 | wlr_output_damage_add_box(output->damage, &box); | 651 | wlr_output_damage_add_box(output->damage, &box); |