From 6e36ccb1bd4ca6a5e4374e1fa50e519599d7a060 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Wed, 16 Aug 2023 10:59:34 +0400 Subject: Implement wp-presentation --- src/layout.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/layout.rs') 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 MonitorSet { }) } + pub fn windows_for_output(&self, output: &Output) -> impl Iterator + '_ { + 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> { let MonitorSet::Normal { monitors, -- cgit