diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-10-15 18:58:36 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-10-15 18:58:48 +0400 |
| commit | 052ecdbe2ae5d13e32a6a11ed5d6f5cdf5531674 (patch) | |
| tree | ed810c849e48db79f691c5d186c59076bf5489e2 /src | |
| parent | da59dfc5b4b6046475c36a377be661fbf3351bd0 (diff) | |
| download | niri-052ecdbe2ae5d13e32a6a11ed5d6f5cdf5531674.tar.gz niri-052ecdbe2ae5d13e32a6a11ed5d6f5cdf5531674.tar.bz2 niri-052ecdbe2ae5d13e32a6a11ed5d6f5cdf5531674.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/niri.rs | 16 |
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); |
