Use WlOutput instead of output names for matching
With a shared wayland connection between the code here and iced, if we don't bind outputs outselves, we can have `WlOutput`s that match. This simplifies things.
This commit is contained in:
parent
96cd334b81
commit
9598a9f8e4
6 changed files with 53 additions and 142 deletions
|
|
@ -1,7 +1,4 @@
|
|||
use cctk::{
|
||||
wayland_client::Proxy,
|
||||
workspace::{WorkspaceHandler, WorkspaceState},
|
||||
};
|
||||
use cctk::workspace::{WorkspaceHandler, WorkspaceState};
|
||||
|
||||
use super::{AppData, CaptureSource, Event};
|
||||
|
||||
|
|
@ -18,20 +15,13 @@ impl WorkspaceHandler for AppData {
|
|||
|
||||
for group in self.workspace_state.workspace_groups() {
|
||||
for workspace in &group.workspaces {
|
||||
let output_names: Vec<_> = group
|
||||
.outputs
|
||||
.iter()
|
||||
.filter_map(|output| self.output_names.get(&output.id()).cloned()?)
|
||||
.collect();
|
||||
if !output_names.is_empty() {
|
||||
workspaces.push((output_names, workspace.clone()));
|
||||
workspaces.push((group.outputs.iter().cloned().collect(), workspace.clone()));
|
||||
|
||||
for output in &group.outputs {
|
||||
self.add_capture_source(CaptureSource::Workspace(
|
||||
workspace.handle.clone(),
|
||||
output.clone(),
|
||||
));
|
||||
}
|
||||
for output in &group.outputs {
|
||||
self.add_capture_source(CaptureSource::Workspace(
|
||||
workspace.handle.clone(),
|
||||
output.clone(),
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue