diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-08-27 17:44:22 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-08-27 17:44:22 +0400 |
| commit | 1575753b69cabf7f4d84f765a025ce1d7672b522 (patch) | |
| tree | c69768d4c35f06602c402f27c04a7eb39caa5d5c /src/layout.rs | |
| parent | c3d2505487900b5c224b6a6e2171c2164713dec5 (diff) | |
| download | niri-1575753b69cabf7f4d84f765a025ce1d7672b522.tar.gz niri-1575753b69cabf7f4d84f765a025ce1d7672b522.tar.bz2 niri-1575753b69cabf7f4d84f765a025ce1d7672b522.zip | |
Extract different parts of rendering into functions
Diffstat (limited to 'src/layout.rs')
| -rw-r--r-- | src/layout.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/layout.rs b/src/layout.rs index fbb0e801..24a51b42 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -582,6 +582,14 @@ impl<W: LayoutElement> MonitorSet<W> { Some(&mut monitors[*active_monitor_idx]) } + pub fn monitor_for_output(&self, output: &Output) -> Option<&Monitor<W>> { + let MonitorSet::Normal { monitors, .. } = self else { + return None; + }; + + monitors.iter().find(|monitor| &monitor.output == output) + } + pub fn monitor_for_output_mut(&mut self, output: &Output) -> Option<&mut Monitor<W>> { let MonitorSet::Normal { monitors, .. } = self else { return None; |
