Check for ongoing animations earlier

Removes the inconsistency that when animating towards an empty
pointer position, the focus change would not wait until the end of the
animation.
This commit is contained in:
Ivan Molodetskikh
2023-10-15 18:58:36 +04:00
parent da59dfc5b4
commit 052ecdbe2a
+8 -8
View File
@@ -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);