aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/niri.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/niri.rs b/src/niri.rs
index 9f6e6da6..29bfc905 100644
--- a/src/niri.rs
+++ b/src/niri.rs
@@ -275,6 +275,14 @@ impl State {
let pointer = &self.niri.seat.get_pointer().unwrap();
let location = pointer.current_location();
+ // Don't refresh cursor focus during animations.
+ if let Some((output, _)) = self.niri.output_under(location) {
+ let monitor = self.niri.layout.monitor_for_output(output).unwrap();
+ if monitor.are_animations_ongoing() {
+ return;
+ }
+ }
+
let under = self.niri.surface_under_and_global_space(location);
// We're not changing the global cursor location here, so if the focus did not change, then
@@ -283,14 +291,6 @@ impl State {
return;
}
- // Don't refresh cursor focus during animations.
- if let Some(PointerFocus { output, .. }) = &under {
- let monitor = self.niri.layout.monitor_for_output(output).unwrap();
- if monitor.are_animations_ongoing() {
- return;
- }
- }
-
self.niri.pointer_focus = under.clone();
let under = under.map(|u| u.surface);