mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-21 02:01:55 +07:00
Avoid continuous redrawing during horizontal gesture
This commit is contained in:
@@ -544,7 +544,10 @@ impl<W: LayoutElement> Monitor<W> {
|
||||
|
||||
pub fn are_transitions_ongoing(&self) -> bool {
|
||||
self.workspace_switch.is_some()
|
||||
|| self.workspaces.iter().any(|ws| ws.are_animations_ongoing())
|
||||
|| self
|
||||
.workspaces
|
||||
.iter()
|
||||
.any(|ws| ws.are_transitions_ongoing())
|
||||
}
|
||||
|
||||
pub fn update_config(&mut self, options: Rc<Options>) {
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user