From 59ff331597633dc66113e5070d672ba70035421b Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Mon, 29 Jan 2024 19:34:12 +0400 Subject: Implement wlr-foreign-toplevel-management The parent event isn't sent but whatever. --- src/layout/mod.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/layout') diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 67b1b139..bedc0979 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -776,6 +776,27 @@ impl Layout { mon.workspaces.iter().flat_map(|ws| ws.windows()) } + pub fn with_windows(&self, mut f: impl FnMut(&W, Option<&Output>)) { + match &self.monitor_set { + MonitorSet::Normal { monitors, .. } => { + for mon in monitors { + for ws in &mon.workspaces { + for win in ws.windows() { + f(win, Some(&mon.output)); + } + } + } + } + MonitorSet::NoOutputs { workspaces } => { + for ws in workspaces { + for win in ws.windows() { + f(win, None); + } + } + } + } + } + fn active_monitor(&mut self) -> Option<&mut Monitor> { let MonitorSet::Normal { monitors, -- cgit