aboutsummaryrefslogtreecommitdiff
path: root/src/layout.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2023-08-16 10:59:34 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2023-08-16 10:59:34 +0400
commit6e36ccb1bd4ca6a5e4374e1fa50e519599d7a060 (patch)
tree59a772a946a7b50593075e73f2edccf7ebf4d8d0 /src/layout.rs
parentd4d2cefe50b13222a2eb45f59d4b80f8b8d4f634 (diff)
downloadniri-6e36ccb1bd4ca6a5e4374e1fa50e519599d7a060.tar.gz
niri-6e36ccb1bd4ca6a5e4374e1fa50e519599d7a060.tar.bz2
niri-6e36ccb1bd4ca6a5e4374e1fa50e519599d7a060.zip
Implement wp-presentation
Diffstat (limited to 'src/layout.rs')
-rw-r--r--src/layout.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/layout.rs b/src/layout.rs
index 8a090c07..d47ff1be 100644
--- a/src/layout.rs
+++ b/src/layout.rs
@@ -560,6 +560,15 @@ impl<W: LayoutElement> MonitorSet<W> {
})
}
+ pub fn windows_for_output(&self, output: &Output) -> impl Iterator<Item = &W> + '_ {
+ let MonitorSet::Normal { monitors, .. } = self else {
+ panic!()
+ };
+
+ let mon = monitors.iter().find(|mon| &mon.output == output).unwrap();
+ mon.workspaces.iter().flat_map(|ws| ws.windows())
+ }
+
fn active_monitor(&mut self) -> Option<&mut Monitor<W>> {
let MonitorSet::Normal {
monitors,