diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-07-05 20:12:56 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-07-05 20:53:11 +0400 |
| commit | 1da99f4003c100180b4821afc4e32e35c86dfdb4 (patch) | |
| tree | 70f465e9e585e5547f79ad6ac94a0828de588ad9 /src/niri.rs | |
| parent | 120eaa6c56491e284a6a1a8bfb49ef477b8c0854 (diff) | |
| download | niri-1da99f4003c100180b4821afc4e32e35c86dfdb4.tar.gz niri-1da99f4003c100180b4821afc4e32e35c86dfdb4.tar.bz2 niri-1da99f4003c100180b4821afc4e32e35c86dfdb4.zip | |
Implement focus-follows-mouse max-scroll-amount
Diffstat (limited to 'src/niri.rs')
| -rw-r--r-- | src/niri.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/niri.rs b/src/niri.rs index 08331bef..2ff2f014 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -4140,9 +4140,9 @@ impl Niri { } pub fn handle_focus_follows_mouse(&mut self, new_focus: &PointerFocus) { - if !self.config.borrow().input.focus_follows_mouse { + let Some(ffm) = self.config.borrow().input.focus_follows_mouse else { return; - } + }; let pointer = &self.seat.get_pointer().unwrap(); if pointer.is_grabbed() { @@ -4160,6 +4160,12 @@ impl Niri { if let Some(window) = &new_focus.window { if current_focus.window.as_ref() != Some(window) { + if let Some(threshold) = ffm.max_scroll_amount { + if self.layout.scroll_amount_to_activate(window) > threshold.0 { + return; + } + } + self.layout.activate_window(window); } } |
