improv(app-list): only send screencopy requests as needed

This commit is contained in:
Ryan Brue 2024-04-01 19:53:58 -05:00 committed by Michael Murphy
parent 2f1b20e1c7
commit 769af3d944
3 changed files with 11 additions and 5 deletions

View file

@ -658,6 +658,12 @@ impl cosmic::Application for CosmicAppList {
.chain(self.favorite_list.iter())
.find(|t| t.desktop_info.id == id)
{
for (ref handle, _, _) in &toplevel_group.toplevels {
if let Some(tx) = self.wayland_sender.as_ref() {
let _ = tx.send(WaylandRequest::Screencopy(handle.clone()));
}
}
let rectangle = match self.rectangles.get(&toplevel_group.id) {
Some(r) => r,
None => return Command::none(),