Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions libwayshot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,17 +526,14 @@ impl WayshotConnection {
| wl_shm::Format::Bgr888
)
})
.copied();
.copied()
// Check if frame format exists.
.ok_or_else(|| {
tracing::error!("No suitable frame format found");
Error::NoSupportedBufferFormat
})?;
tracing::trace!("Selected frame buffer format: {:#?}", frame_format);

// Check if frame format exists.
let frame_format = match frame_format {
Some(format) => format,
None => {
tracing::error!("No suitable frame format found");
return Err(Error::NoSupportedBufferFormat);
}
};
Ok((state, event_queue, frame, frame_format))
}

Expand Down Expand Up @@ -816,7 +813,7 @@ impl WayshotConnection {
Ok(x) => x,
Err(e) => {
tracing::error!(
"Failed to create compositor Does your compositor implement WlCompositor?"
"Failed to create compositor. Does your compositor implement WlCompositor?"
);
tracing::error!("err: {e}");
return Err(Error::ProtocolNotFound(
Expand Down Expand Up @@ -1065,7 +1062,8 @@ impl WayshotConnection {
) -> Result<DynamicImage> {
self.screenshot_region_capturer(RegionCapturer::Freeze(callback), cursor_overlay)
}
/// shot one ouput

/// Take a screenshot from one output
pub fn screenshot_single_output(
&self,
output_info: &OutputInfo,
Expand Down