aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2020-12-05 00:01:29 +0100
committerSimon Ser <contact@emersion.fr>2020-12-06 17:11:46 +0100
commit1477401acd327ddbe56e412c79a0e666fedb5cc3 (patch)
treece4d89e2cb74dd943e2afbaf558ed7de64cacc89
parent90c8452959470461497c4a83aac0bd93efb0a524 (diff)
screencopy: handle compositor not setting damage
Damage the full output if the compositor didn't submit damage but did submit a buffer.
-rw-r--r--types/wlr_screencopy_v1.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/types/wlr_screencopy_v1.c b/types/wlr_screencopy_v1.c
index 2d81ff7b..59cd5b9d 100644
--- a/types/wlr_screencopy_v1.c
+++ b/types/wlr_screencopy_v1.c
@@ -48,9 +48,20 @@ static void screencopy_damage_accumulate(struct screencopy_damage *damage) {
return;
}
- pixman_region32_union(region, region, &output->pending.damage);
- pixman_region32_intersect_rect(region, region, 0, 0, output->width,
- output->height);
+ // If the compositor did not submit damage but did submit a buffer,
+ if (!(output->pending.committed & WLR_OUTPUT_STATE_DAMAGE) &&
+ (output->pending.committed & WLR_OUTPUT_STATE_BUFFER)) {
+ // damage everything
+ int width, height;
+ wlr_output_transformed_resolution(output, &width, &height);
+ pixman_region32_union_rect(region, region, 0, 0, width, height);
+ } else {
+ // otherwise copy over the current damage
+ pixman_region32_union(region, region, &output->pending.damage);
+ pixman_region32_intersect_rect(region, region, 0, 0, output->width,
+ output->height);
+ }
+
damage->last_commit_seq = output->commit_seq;
}