summaryrefslogtreecommitdiff
path: root/src/evdev-fallback.c
diff options
context:
space:
mode:
authorDaniel van Vugt <daniel.van.vugt@canonical.com>2018-03-01 17:03:28 +0800
committerPeter Hutterer <peter.hutterer@who-t.net>2018-03-05 10:40:48 +1000
commit6936a15558f7baa047bdb7e31604ef29be1ae552 (patch)
treea7540576ed9633ef5e0bf55d125af145494128b4 /src/evdev-fallback.c
parent440d94be57ffa7c826967e0a623700e7c7e759b7 (diff)
Introduce omnidirectional (elliptical) hysteresis
This changes the hysteresis region to an ellipse (usually a circle), where previously it was a rectangle (usually square). Using an ellipse means the algorithm is no longer more sensitive in some directions than others. It is now omnidirectional, which solves a few problems: * Moving a finger in small circles now creates circles, not squares. * Moving a finger in a curve no longer snaps the cursor to vertical or horizontal lines. The cursor now follows a similar curve to the finger. https://bugs.freedesktop.org/page.cgi?id=splinter.html&bug=105306 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/evdev-fallback.c')
-rw-r--r--src/evdev-fallback.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/evdev-fallback.c b/src/evdev-fallback.c
index 03f10a85..d1ca81f0 100644
--- a/src/evdev-fallback.c
+++ b/src/evdev-fallback.c
@@ -127,12 +127,9 @@ fallback_filter_defuzz_touch(struct fallback_dispatch *dispatch,
if (!dispatch->mt.want_hysteresis)
return false;
- point.x = evdev_hysteresis(slot->point.x,
- slot->hysteresis_center.x,
- dispatch->mt.hysteresis_margin.x);
- point.y = evdev_hysteresis(slot->point.y,
- slot->hysteresis_center.y,
- dispatch->mt.hysteresis_margin.y);
+ point = evdev_hysteresis(&slot->point,
+ &slot->hysteresis_center,
+ &dispatch->mt.hysteresis_margin);
slot->hysteresis_center = slot->point;
if (point.x == slot->point.x && point.y == slot->point.y)