diff options
author | Arturo Castro <arturo@openframeworks.cc> | 2010-04-11 11:06:24 +0200 |
---|---|---|
committer | Henrik Rydberg <rydberg@euromail.se> | 2010-04-15 06:10:08 +0200 |
commit | f50f824f0e32aaa60ebf30fe66a002182c26c8a4 (patch) | |
tree | 1461dba37c0ed1cf2896a2048fa542a455e4602c /src | |
parent | 2ca4aae84c619bbf2ef6bc21824ad6ca5819fc45 (diff) | |
download | xorg-input-kobomultitouch-f50f824f0e32aaa60ebf30fe66a002182c26c8a4.tar.gz xorg-input-kobomultitouch-f50f824f0e32aaa60ebf30fe66a002182c26c8a4.tar.bz2 xorg-input-kobomultitouch-f50f824f0e32aaa60ebf30fe66a002182c26c8a4.zip |
Drop movement during gesture decay
With this patch, finger motion is divided into two phases; one attack
phase where fingers are added to the trackpad, and one decay phase, where
fingers leave the trackpad. The decay delay is set considerably larger
than the attack delay. The prime effect is to ignore accidental pointer
movement right after a two-finger scroll.
Signed-off-by: Arturo Castro <arturo@openframeworks.cc>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src')
-rw-r--r-- | src/gestures.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gestures.c b/src/gestures.c index 44b9613..fb81576 100644 --- a/src/gestures.c +++ b/src/gestures.c @@ -26,7 +26,8 @@ #include "gestures.h" /* timer for cursor stability on finger touch/release */ -static const int AFTER_FINGER_CHANGE_MS = 70; +static const int FINGER_ATTACK_MS = 70; +static const int FINGER_DECAY_MS = 120; static void extract_movement(struct Gestures *gs, struct MTouch* mt) { @@ -51,7 +52,11 @@ static void extract_movement(struct Gestures *gs, struct MTouch* mt) y /= mt->state.nfinger; if (!same_fingers) { - mt->mem.move_time = mt->state.evtime + AFTER_FINGER_CHANGE_MS; + mt->mem.move_time = mt->state.evtime; + if (mt->state.nfinger > mt->prev_state.nfinger) + mt->mem.move_time += FINGER_ATTACK_MS; + else + mt->mem.move_time += FINGER_DECAY_MS; } else if (mt->state.evtime >= mt->mem.move_time) { gs->dx = x - mt->mem.move_x; gs->dy = y - mt->mem.move_y; |