From 841384969a0b080bdc860c1bda43b68f9c904daf Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Fri, 25 Mar 2011 19:57:52 +0100 Subject: Never active gestures below activation threshold Currently, all gestures activate after a certain time, such that the smallest change result in gesture events. This was designed to minimize disruption in pointer movement. Since grail no longer handles pointers, the logic can be simplified to only activate when the threshold is reached. Signed-off-by: Henrik Rydberg --- src/grail-gestures.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/grail-gestures.c') diff --git a/src/grail-gestures.c b/src/grail-gestures.c index 2c0fc40..fd8b26b 100644 --- a/src/grail-gestures.c +++ b/src/grail-gestures.c @@ -133,15 +133,14 @@ static void move_update(struct move_model *m, int i, float x, grail_time_t t) m->tickle &= ~(1 << i); if (m->active & (1 << i)) return; - fm->action_delta = x - fm->original; - if (t - fm->original_ms > fm->hold_ms && - fabs(fm->action_delta) > fm->bar) { - m->active |= (1 << i); + fm->action_delta = 0; + if (fabs(x - fm->original) > fm->bar) { + if (t - fm->original_ms > fm->hold_ms) { + m->active |= (1 << i); + fm->action_delta = x - fm->original; + } } else if (t - fm->original_ms > fm->bar_ms) { - m->active |= (1 << i); m->timeout |= (1 << i); - } else { - fm->action_delta = 0; } } -- cgit v1.2.3