From 8bde252ba4c8f552cc8bcabcd2b277278884781d Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sat, 21 Oct 2023 20:46:41 +0400 Subject: Stop updating focus during transitions This also includes touchpad swipes. --- src/layout.rs | 5 +++++ src/niri.rs | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/layout.rs b/src/layout.rs index a85b7dd7..41dc0d4a 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -1634,6 +1634,11 @@ impl Monitor { || self.workspaces.iter().any(|ws| ws.are_animations_ongoing()) } + pub fn are_transitions_ongoing(&self) -> bool { + self.workspace_switch.is_some() + || self.workspaces.iter().any(|ws| ws.are_animations_ongoing()) + } + fn update_config(&mut self, options: Rc) { for ws in &mut self.workspaces { ws.update_config(options.clone()); diff --git a/src/niri.rs b/src/niri.rs index 29bfc905..e54f64f9 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -275,10 +275,10 @@ impl State { let pointer = &self.niri.seat.get_pointer().unwrap(); let location = pointer.current_location(); - // Don't refresh cursor focus during animations. + // Don't refresh cursor focus during transitions. if let Some((output, _)) = self.niri.output_under(location) { let monitor = self.niri.layout.monitor_for_output(output).unwrap(); - if monitor.are_animations_ongoing() { + if monitor.are_transitions_ongoing() { return; } } -- cgit