feature: screen freeze - #123
Conversation
|
But libwayshot also relies on libwaysip, but with setting it optional, I think it will be fine.. Can the freeze part be induced in waysip not libwaysip? for example, add an api to set the background we can add an callback before the capture, and there capture the output, then let libwaysip set it as the background, then the dependency won't be part of the libwaysip, but waysip instead |
|
https://github.com/waycrate/waysip/blob/master/libwaysip/src/lib.rs#L263-L280 we can add a callback field here to Waysip, for example Box<dyn Fn(&wl_output::WlOutput) -> Option<cairo::Surface> + 'static>and this will add an extra background for it. Then we can move the logic to the waysip not libwaysip |
|
@Decodetalkers |
|
|
||
| use std::collections::HashMap; | ||
|
|
||
| use wayland_client::protocol::wl_output::WlOutput; |
There was a problem hiding this comment.
I think libwayshot has already reexported the WlOutput, we can use that directly
| /// screenshot backend itself couldn't be initialised. | ||
| pub fn capture_backgrounds() | ||
| -> Option<impl Fn(&WlOutput, &str) -> Option<cairo::ImageSurface> + 'static> { | ||
| let wayshot_conn = match libwayshot::WayshotConnection::new() { |
There was a problem hiding this comment.
We should let waysip and libwayshot use the same connection, then you do not need to find them again
|
after modified libwayshot, I make this patch This is what I have changed based on this pr |
|
maybe your is better.. Emm..mime created wayshot connection for too many times.. Maybe we can let wayshot connection implement Clone. create new queue, and clone all the registered things |
Decodetalkers
left a comment
There was a problem hiding this comment.
I should admit yours is better, LGTM
|
I think it is fine, let me merge it |
|
Thanks! |
This PR addes screen freeze feature via
libwayshot's capabilities. The usecase for this is runningwayshot -g $"(waysip -d --freeze)"-- since calling a binary onwayshot -g $"(waysip -d)"is impossible to make freezable without dirty hacks (e.g. addingwaysip/slurp/etc cmd tracking onwayshotside).I only added a minimal subset of
libwayshot/imagecrate's features, so it does not pull lots of new deps, plus I made it completely optional.