aboutsummaryrefslogtreecommitdiff
path: root/src/layout.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2023-09-30 17:13:56 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2023-09-30 17:13:56 +0400
commita3aa5fca12b59df0c1ee421b482a51a425e25abd (patch)
tree3a94f1624912216a3a7e056c4de5d4fcb82b5b4f /src/layout.rs
parent21737abbfdb78698e323c0a9490759b427370a74 (diff)
downloadniri-a3aa5fca12b59df0c1ee421b482a51a425e25abd.tar.gz
niri-a3aa5fca12b59df0c1ee421b482a51a425e25abd.tar.bz2
niri-a3aa5fca12b59df0c1ee421b482a51a425e25abd.zip
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.
Diffstat (limited to 'src/layout.rs')
-rw-r--r--src/layout.rs9
1 files changed, 9 insertions, 0 deletions
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<W: LayoutElement> Monitor<W> {
}
}
+ 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<W: LayoutElement> Workspace<W> {
}
}
+ 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;