Handle damage in image-copy-capture protocol correctly #1651
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Based on #1638.
It seems
age_for_buffershouldn't really be necessary; the client should accumulate damage, and send it withbuffer_damage. Though trying to change just that revealed thatadditional_damagewasn't being handled properly; it was placed incorrectly in the z-order of the render elements, so it didn't work properly where it was occluded by render elements with opaque regions.pop-os/cosmic-workspaces-epoch#217 updates cosmic-workspaces to accumulate damage, and send it in
damage_buffer.xdg-desktop-portal-cosmicalready does.This appears to work, but may be worth testing a bit more.
I guess we also don't have anything to delay toplevel and workspace capture of a new frame until there is new damage? We probably want that, though hopefully if we track damage properly it won't add too much overhead to capture extra frames that are identical.