image-copy: Use abstraction that's now provided by Smithay

This doesn't change much, since the Smithay implementation is based on
the `cosmic-comp` version, but made more generic. We provide our own
implementation for our workspace capture protocol, but otherwise Smithay
handles the boilerplate now.

This should not cause any change in behavior.
This commit is contained in:
Ian Douglas Scott 2026-01-13 18:26:26 -08:00 committed by Victoria Brekenfeld
parent 0f7e53b600
commit cac7a5aca6
16 changed files with 285 additions and 1536 deletions

View file

@ -8,7 +8,7 @@ use crate::{
config::{CompTransformDef, EdidProduct, ScreenFilter},
shell::Shell,
utils::{env::dev_list_var, prelude::*},
wayland::handlers::screencopy::PendingImageCopyData,
wayland::handlers::image_copy_capture::PendingImageCopyData,
};
use anyhow::{Context, Result};

View file

@ -11,14 +11,9 @@ use crate::{
shell::Shell,
state::SurfaceDmabufFeedback,
utils::prelude::*,
wayland::{
handlers::{
compositor::recursive_frame_time_estimation,
screencopy::{FrameHolder, PendingImageCopyData, SessionData, submit_buffer},
},
protocols::screencopy::{
FailureReason, Frame as ScreencopyFrame, SessionRef as ScreencopySessionRef,
},
wayland::handlers::{
compositor::recursive_frame_time_estimation,
image_copy_capture::{FrameHolder, PendingImageCopyData, SessionData, submit_buffer},
},
};
@ -82,6 +77,9 @@ use smithay::{
utils::{Clock, Monotonic, Physical, Point, Rectangle, Transform},
wayland::{
dmabuf::{DmabufFeedbackBuilder, get_dmabuf},
image_copy_capture::{
CaptureFailureReason, Frame as ScreencopyFrame, SessionRef as ScreencopySessionRef,
},
presentation::Refresh,
seat::WaylandFocus,
shm::{shm_format_to_fourcc, with_buffer_contents},
@ -1398,7 +1396,7 @@ impl SurfaceThreadState {
.lock()
.unwrap()
.reset();
frame.fail(FailureReason::Unknown);
frame.fail(CaptureFailureReason::Unknown);
}
return Err(err).with_context(|| "Failed to submit result for display");
}

View file

@ -35,7 +35,7 @@ use crate::{
handlers::{
compositor::FRAME_TIME_FILTER,
data_device::get_dnd_icon,
screencopy::{FrameHolder, SessionData, render_session},
image_copy_capture::{FrameHolder, SessionData, render_session},
},
protocols::workspace::WorkspaceHandle,
},