mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
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:
+8
-8
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user