summaryrefslogtreecommitdiff
path: root/src/evdev-mt-touchpad-edge-scroll.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2015-06-19 09:21:58 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2015-06-24 08:14:33 +1000
commitf783dae0a70e660f8fc0175b4a702bd3f9953d7d (patch)
tree3281a5878ef756989675cc77aea5a4fe06706f35 /src/evdev-mt-touchpad-edge-scroll.c
parent3195b95d1d814cdb35289fc5e3cfad97f00971bf (diff)
downloadlibinput-f783dae0a70e660f8fc0175b4a702bd3f9953d7d.tar.gz
touchpad: only send most recent edge delta when triggering threshold
When edge scrolling is triggered by exceeding the motion threshold (5mm) we sent the whole delta as the first scroll event, causing a big jump. Instead, send only the current delta. This effectively introduces a 5mm dead zone when edge scrolling, still better than the jump. https://bugs.freedesktop.org/show_bug.cgi?id=90990 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'src/evdev-mt-touchpad-edge-scroll.c')
-rw-r--r--src/evdev-mt-touchpad-edge-scroll.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/evdev-mt-touchpad-edge-scroll.c b/src/evdev-mt-touchpad-edge-scroll.c
index 56f1e8a0..992a1693 100644
--- a/src/evdev-mt-touchpad-edge-scroll.c
+++ b/src/evdev-mt-touchpad-edge-scroll.c
@@ -353,7 +353,7 @@ tp_edge_scroll_post_events(struct tp_dispatch *tp, uint64_t time)
struct tp_touch *t;
enum libinput_pointer_axis axis;
double *delta;
- struct normalized_coords normalized;
+ struct normalized_coords normalized, tmp;
const struct normalized_coords zero = { 0.0, 0.0 };
const struct discrete_coords zero_discrete = { 0.0, 0.0 };
@@ -402,11 +402,14 @@ tp_edge_scroll_post_events(struct tp_dispatch *tp, uint64_t time)
t->scroll.edge_state);
break;
case EDGE_SCROLL_TOUCH_STATE_EDGE_NEW:
+ tmp = normalized;
normalized = tp_normalize_delta(tp,
device_delta(t->point,
t->scroll.initial));
if (fabs(*delta) < DEFAULT_SCROLL_THRESHOLD)
normalized = zero;
+ else
+ normalized = tmp;
break;
case EDGE_SCROLL_TOUCH_STATE_EDGE:
break;