From 9aafef352b493154e461d4925b7b938fa21c937b Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sat, 27 Apr 2019 17:49:37 +0300 Subject: [PATCH] Don't submit too much damage --- sway/desktop/render.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/sway/desktop/render.c b/sway/desktop/render.c index 8e848359..6bea5656 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c @@ -1078,15 +1078,22 @@ renderer_end: int width, height; wlr_output_transformed_resolution(wlr_output, &width, &height); - if (debug.damage == DAMAGE_HIGHLIGHT) { - pixman_region32_union_rect(damage, damage, 0, 0, width, height); - } + pixman_region32_t frame_damage; + pixman_region32_init(&frame_damage); enum wl_output_transform transform = wlr_output_transform_invert(wlr_output->transform); - wlr_region_transform(damage, damage, transform, width, height); + wlr_region_transform(&frame_damage, &output->damage->current, + transform, width, height); + + if (debug.damage == DAMAGE_HIGHLIGHT) { + pixman_region32_union_rect(&frame_damage, &frame_damage, + 0, 0, wlr_output->width, wlr_output->height); + } + + wlr_output_set_damage(wlr_output, &frame_damage); + pixman_region32_fini(&frame_damage); - wlr_output_set_damage(wlr_output, damage); if (!wlr_output_commit(wlr_output)) { return; }