image-copy: Hold references to Buffers to block release

The `wl_buffer` now won't be released until sync fence polls ready.
This commit is contained in:
Ian Douglas Scott 2026-07-07 11:46:42 -07:00 • committed by Victoria Brekenfeld
parent d84d5d46ce
commit dd6ebd03c9
3 changed files with 103 additions and 43 deletions

View file

@ -1674,7 +1674,7 @@ fn send_screencopy_result<'a>(
pre_postprocess_data: &mut PrePostprocessData,
tx: &std::sync::mpsc::Sender<PendingImageCopyData>,
frame_result: &RenderFrameResult<GbmBuffer, GbmFramebuffer, CosmicElement<GlMultiRenderer<'a>>>,
elements: &[CosmicElement<GlMultiRenderer>],
elements: &[CosmicElement<GlMultiRenderer<'a>>],
(session, frame, res): (
&ScreencopySessionRef,
ScreencopyFrame,
@ -1855,6 +1855,8 @@ fn send_screencopy_result<'a>(
transform,
damage.as_deref(),
sync,
// Don't reference `Buffer`s since we blit from framebuffer/postprocess buffer
vec![],
)? {
if frame_result.is_empty {
data.frame