diff options
-rw-r--r-- | sway/desktop/output.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index a86c1646..1211cc07 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -1163,11 +1163,17 @@ static void damage_surface_iterator(struct wlr_surface *surface, int sx, int sy, | |||
1163 | int center_x = box.x + box.width/2; | 1163 | int center_x = box.x + box.width/2; |
1164 | int center_y = box.y + box.height/2; | 1164 | int center_y = box.y + box.height/2; |
1165 | 1165 | ||
1166 | if (pixman_region32_not_empty(&surface->current.surface_damage)) { | 1166 | if (pixman_region32_not_empty(&surface->buffer_damage)) { |
1167 | enum wl_output_transform transform = | ||
1168 | wlr_output_transform_invert(surface->current.transform); | ||
1169 | |||
1167 | pixman_region32_t damage; | 1170 | pixman_region32_t damage; |
1168 | pixman_region32_init(&damage); | 1171 | pixman_region32_init(&damage); |
1169 | pixman_region32_copy(&damage, &surface->current.surface_damage); | 1172 | pixman_region32_copy(&damage, &surface->buffer_damage); |
1170 | wlr_region_scale(&damage, &damage, output->wlr_output->scale); | 1173 | wlr_region_transform(&damage, &damage, transform, |
1174 | surface->current.buffer_width, surface->current.buffer_height); | ||
1175 | wlr_region_scale(&damage, &damage, | ||
1176 | output->wlr_output->scale / (float)surface->current.scale); | ||
1171 | if (ceil(output->wlr_output->scale) > surface->current.scale) { | 1177 | if (ceil(output->wlr_output->scale) > surface->current.scale) { |
1172 | // When scaling up a surface, it'll become blurry so we need to | 1178 | // When scaling up a surface, it'll become blurry so we need to |
1173 | // expand the damage region | 1179 | // expand the damage region |