diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-07-05 10:13:50 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-07-05 10:13:50 +0400 |
| commit | de6caec685a304045b04db16e23eb5928685de6c (patch) | |
| tree | c689461bf767650424412350365a380e1a290d18 /src | |
| parent | c8411e55d9333174114496a14f0a23abf4a36b7d (diff) | |
| download | niri-de6caec685a304045b04db16e23eb5928685de6c.tar.gz niri-de6caec685a304045b04db16e23eb5928685de6c.tar.bz2 niri-de6caec685a304045b04db16e23eb5928685de6c.zip | |
Recompute current pointer focus for focus-follows-mouse
Fixes https://github.com/YaLTeR/niri/issues/377.
Diffstat (limited to 'src')
| -rw-r--r-- | src/niri.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/niri.rs b/src/niri.rs index 177f5765..08331bef 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -4144,18 +4144,22 @@ impl Niri { return; } - if self.seat.get_pointer().unwrap().is_grabbed() { + let pointer = &self.seat.get_pointer().unwrap(); + if pointer.is_grabbed() { return; } + // Recompute the current pointer focus because we don't update it during animations. + let current_focus = self.surface_under_and_global_space(pointer.current_location()); + if let Some(output) = &new_focus.output { - if self.pointer_focus.output.as_ref() != Some(output) { + if current_focus.output.as_ref() != Some(output) { self.layout.focus_output(output); } } if let Some(window) = &new_focus.window { - if self.pointer_focus.window.as_ref() != Some(window) { + if current_focus.window.as_ref() != Some(window) { self.layout.activate_window(window); } } |
