From a3aa5fca12b59df0c1ee421b482a51a425e25abd Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sat, 30 Sep 2023 17:13:56 +0400 Subject: Refactor frame scheduling Combine the redraw state variables into one enum, and refactor to get rid of the requirement that a VBlank must queue a subsequent redraw. Also fix the bug where ongoing animations that produced no damage could stall the redrawing. --- 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 4a272f9d..f878ed9e 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -1328,6 +1328,11 @@ impl Monitor { } } + pub fn are_animations_ongoing(&self) -> bool { + self.workspace_idx_anim.is_some() + || self.workspaces.iter().any(|ws| ws.are_animations_ongoing()) + } + pub fn update_config(&mut self, config: &Config) { for ws in &mut self.workspaces { ws.update_config(config); @@ -1464,6 +1469,10 @@ impl Workspace { } } + pub fn are_animations_ongoing(&self) -> bool { + self.view_offset_anim.is_some() + } + pub fn update_config(&mut self, config: &Config) { let c = &config.focus_ring; self.focus_ring.is_off = c.off; -- cgit