diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-03-03 09:26:29 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-03-03 09:33:00 +0400 |
| commit | 2e51efd3a3d799862a24bfac2d33ec7b7413f276 (patch) | |
| tree | d1aa6a1e9ba59d24f378056f53f7472c87ff0c8e /src/input.rs | |
| parent | caea05433e77cb4523070473e5b50b1831db5608 (diff) | |
| download | niri-2e51efd3a3d799862a24bfac2d33ec7b7413f276.tar.gz niri-2e51efd3a3d799862a24bfac2d33ec7b7413f276.tar.bz2 niri-2e51efd3a3d799862a24bfac2d33ec7b7413f276.zip | |
Remake horizontal gesture to snap with inertia
Diffstat (limited to 'src/input.rs')
| -rw-r--r-- | src/input.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/input.rs b/src/input.rs index db415a49..15af28e6 100644 --- a/src/input.rs +++ b/src/input.rs @@ -1219,12 +1219,10 @@ impl State { let mut delta_x = event.delta_x(); let mut delta_y = event.delta_y(); - // FIXME: remove once X is also unaccelerated. - let delta_y_accel = delta_y; - if let Some(libinput_event) = (&event as &dyn Any).downcast_ref::<input::event::gesture::GestureSwipeUpdateEvent>() { + delta_x = libinput_event.dx_unaccelerated(); delta_y = libinput_event.dy_unaccelerated(); } @@ -1238,7 +1236,7 @@ impl State { if let Some((cx, cy)) = &mut self.niri.gesture_swipe_3f_cumulative { *cx += delta_x; - *cy += delta_y_accel; + *cy += delta_y; // Check if the gesture moved far enough to decide. Threshold copied from GNOME Shell. let (cx, cy) = (*cx, *cy); |
