diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-05-04 11:10:02 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-05-04 11:10:02 +0400 |
| commit | 73cc0079d628e66b1d64168ed1a10b13b23ab5d0 (patch) | |
| tree | 168aa5d885c2061c8ec9090e1cd46b865a6f2a42 /src/layout/mod.rs | |
| parent | 69aeba2a4d93b34eb24319c3694ad354dc608a87 (diff) | |
| download | niri-73cc0079d628e66b1d64168ed1a10b13b23ab5d0.tar.gz niri-73cc0079d628e66b1d64168ed1a10b13b23ab5d0.tar.bz2 niri-73cc0079d628e66b1d64168ed1a10b13b23ab5d0.zip | |
Split update_render_elements() from advance_animations()
advance_animations() is called from places like input, whereas
update_render_elements() is strictly for rendering.
Diffstat (limited to 'src/layout/mod.rs')
| -rw-r--r-- | src/layout/mod.rs | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index b670b9f5..b93dfb4d 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -1354,23 +1354,40 @@ impl<W: LayoutElement> Layout<W> { let _span = tracy_client::span!("Layout::advance_animations"); match &mut self.monitor_set { - MonitorSet::Normal { - monitors, - active_monitor_idx, - .. - } => { - for (idx, mon) in monitors.iter_mut().enumerate() { - mon.advance_animations(current_time, idx == *active_monitor_idx); + MonitorSet::Normal { monitors, .. } => { + for mon in monitors { + mon.advance_animations(current_time); } } MonitorSet::NoOutputs { workspaces, .. } => { for ws in workspaces { - ws.advance_animations(current_time, false); + ws.advance_animations(current_time); } } } } + pub fn update_render_elements(&mut self, output: &Output) { + let _span = tracy_client::span!("Layout::update_render_elements"); + + let MonitorSet::Normal { + monitors, + active_monitor_idx, + .. + } = &mut self.monitor_set + else { + error!("update_render_elements called with no monitors"); + return; + }; + + for (idx, mon) in monitors.iter_mut().enumerate() { + if mon.output == *output { + mon.update_render_elements(idx == *active_monitor_idx); + return; + } + } + } + pub fn update_shaders(&mut self) { match &mut self.monitor_set { MonitorSet::Normal { monitors, .. } => { |
