Drop CaptureImages that don't match new capture filter
This commit is contained in:
parent
a863e8f7d6
commit
5351feb0ce
1 changed files with 15 additions and 1 deletions
16
src/main.rs
16
src/main.rs
|
|
@ -301,7 +301,7 @@ impl App {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_capture_filter(&self) {
|
fn update_capture_filter(&mut self) {
|
||||||
let mut capture_filter = backend::CaptureFilter::default();
|
let mut capture_filter = backend::CaptureFilter::default();
|
||||||
if self.visible {
|
if self.visible {
|
||||||
capture_filter.workspaces_on_outputs =
|
capture_filter.workspaces_on_outputs =
|
||||||
|
|
@ -313,6 +313,20 @@ impl App {
|
||||||
.map(|x| x.handle().clone())
|
.map(|x| x.handle().clone())
|
||||||
.collect();
|
.collect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Drop `CaptureImage` for workspaces and toplevels not matching new
|
||||||
|
// filter.
|
||||||
|
for workspace in &mut self.workspaces {
|
||||||
|
if !capture_filter.workspace_outputs_matches(&workspace.outputs) {
|
||||||
|
workspace.img = None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for toplevel in &mut self.toplevels {
|
||||||
|
if !capture_filter.toplevel_matches(&toplevel.info) {
|
||||||
|
toplevel.img = None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
self.send_wayland_cmd(backend::Cmd::CaptureFilter(capture_filter));
|
self.send_wayland_cmd(backend::Cmd::CaptureFilter(capture_filter));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue