Add workspaces_for_output helper function

This commit is contained in:
Ian Douglas Scott 2025-01-24 15:30:15 -08:00
parent 88b35e3027
commit ba52d69421
2 changed files with 13 additions and 6 deletions

View file

@ -167,6 +167,16 @@ impl App {
self.workspaces.iter_mut().find(|i| &i.handle == handle)
}
// TODO iterate in order based on `coordinates`
fn workspaces_for_output<'a>(
&'a self,
output: &'a wl_output::WlOutput,
) -> impl Iterator<Item = &Workspace> + 'a {
self.workspaces
.iter()
.filter(|w| w.outputs.contains(output))
}
fn toplevel_for_handle_mut(
&mut self,
handle: &ZcosmicToplevelHandleV1,