diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-03-02 14:33:22 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-03-02 14:33:22 +0400 |
| commit | e0ec6e5b11bc222c252157beb064104f4c60dfbe (patch) | |
| tree | 04fd4807424fa75b1dd36e87f9e3bc5b94d91c05 /src/input.rs | |
| parent | 93243d77728c3a0f7d314ed916b5f1a273861990 (diff) | |
| download | niri-e0ec6e5b11bc222c252157beb064104f4c60dfbe.tar.gz niri-e0ec6e5b11bc222c252157beb064104f4c60dfbe.tar.bz2 niri-e0ec6e5b11bc222c252157beb064104f4c60dfbe.zip | |
Make vertical touchpad swipe inertial
Values and implementation are heavily inspired by AdwSwipeTracker.
Diffstat (limited to 'src/input.rs')
| -rw-r--r-- | src/input.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/input.rs b/src/input.rs index d832195a..232cd77f 100644 --- a/src/input.rs +++ b/src/input.rs @@ -1,5 +1,6 @@ use std::any::Any; use std::collections::HashSet; +use std::time::Duration; use niri_config::{Action, Binds, Modifiers}; use niri_ipc::LayoutSwitchTarget; @@ -1242,8 +1243,13 @@ impl State { } } + let timestamp = Duration::from_micros(event.time()); + let mut handled = false; - let res = self.niri.layout.workspace_switch_gesture_update(delta_y); + let res = self + .niri + .layout + .workspace_switch_gesture_update(delta_y, timestamp); if let Some(output) = res { if let Some(output) = output { self.niri.queue_redraw(output); |
