diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-01-29 19:34:12 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-01-30 12:30:57 +0400 |
| commit | 59ff331597633dc66113e5070d672ba70035421b (patch) | |
| tree | 68d8c275a7661337ea64a6f8254a51a41224ab72 /src/layout | |
| parent | b813f99abd2d6e09eb72e8c0083e92b486b4b210 (diff) | |
| download | niri-59ff331597633dc66113e5070d672ba70035421b.tar.gz niri-59ff331597633dc66113e5070d672ba70035421b.tar.bz2 niri-59ff331597633dc66113e5070d672ba70035421b.zip | |
Implement wlr-foreign-toplevel-management
The parent event isn't sent but whatever.
Diffstat (limited to 'src/layout')
| -rw-r--r-- | src/layout/mod.rs | 21 |
1 files changed, 21 insertions, 0 deletions
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<W: LayoutElement> Layout<W> { 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<W>> { let MonitorSet::Normal { monitors, |
