screencopy: handle compositor not setting damage

Damage the full output if the compositor didn't submit damage but did
submit a buffer.
This commit is contained in:
Isaac Freund 2020-12-05 00:01:29 +01:00 committed by Simon Ser
parent 90c8452959
commit 1477401acd

View file

@ -48,9 +48,20 @@ static void screencopy_damage_accumulate(struct screencopy_damage *damage) {
return; return;
} }
pixman_region32_union(region, region, &output->pending.damage); // If the compositor did not submit damage but did submit a buffer,
pixman_region32_intersect_rect(region, region, 0, 0, output->width, if (!(output->pending.committed & WLR_OUTPUT_STATE_DAMAGE) &&
output->height); (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; damage->last_commit_seq = output->commit_seq;
} }