Skip to content

Commit

Permalink
feat(clipboard): handle callback fails
Browse files Browse the repository at this point in the history
  • Loading branch information
CheerfulPianissimo committed Apr 2, 2024
1 parent 7e81b64 commit 8269314
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libwayshot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ impl WayshotConnection {
&self,
frames: &[(FrameCopy, FrameGuard, OutputInfo)],
callback: Box<dyn Fn() -> Result<LogicalRegion, Error>>,
) -> Result<(LogicalRegion)> {
) -> Result<LogicalRegion> {
let mut state = LayerShellState {
configured_outputs: HashSet::new(),
};
Expand Down Expand Up @@ -497,10 +497,10 @@ impl WayshotConnection {
Ok(())
})?;
}
let region = callback()?;
let callback_result = callback();
layer_shell.destroy();
event_queue.blocking_dispatch(&mut state)?;
Ok(region)
callback_result
}

/// Take a screenshot from the specified region.
Expand Down

0 comments on commit 8269314

Please sign in to comment.