diff options
Diffstat (limited to 'src/layout/workspace.rs')
| -rw-r--r-- | src/layout/workspace.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/layout/workspace.rs b/src/layout/workspace.rs index 493a3c54..39e377b5 100644 --- a/src/layout/workspace.rs +++ b/src/layout/workspace.rs @@ -213,6 +213,10 @@ impl OutputId { } impl ViewOffsetAdjustment { + pub fn is_animation(&self) -> bool { + matches!(self, Self::Animation(_)) + } + pub fn target_view_offset(&self) -> f64 { match self { ViewOffsetAdjustment::Animation(anim) => anim.to(), @@ -307,6 +311,14 @@ impl<W: LayoutElement> Workspace<W> { } pub fn are_animations_ongoing(&self) -> bool { + self.view_offset_adj + .as_ref() + .is_some_and(|s| s.is_animation()) + || self.columns.iter().any(Column::are_animations_ongoing) + || !self.closing_windows.is_empty() + } + + pub fn are_transitions_ongoing(&self) -> bool { self.view_offset_adj.is_some() || self.columns.iter().any(Column::are_animations_ongoing) || !self.closing_windows.is_empty() |
