aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2019-04-27 17:49:37 +0300
committerDrew DeVault <sir@cmpwn.com>2019-04-27 09:50:49 -0600
commit9aafef352b493154e461d4925b7b938fa21c937b (patch)
tree8c2b63b8bba63383d4daef7a6630a96bf4168680 /sway
parente6fbb3c6bbeca0b562de528008f3f6bd6cf29f4d (diff)
Don't submit too much damage
Diffstat (limited to 'sway')
-rw-r--r--sway/desktop/render.c17
1 files 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;
}