summaryrefslogtreecommitdiff
path: root/src/gestures-tapping.c
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@canonical.com>2011-02-25 02:12:32 +0100
committerHenrik Rydberg <rydberg@euromail.se>2011-03-14 12:55:19 +0100
commit609e367b3ee2b587f698b65393aa22357f453add (patch)
tree4c6aeec6262d148140697d4ee9a47bd0e860eb15 /src/gestures-tapping.c
parent296cc6e9d0fe0d69045cb288f9f470f3760c4a43 (diff)
Fix tap event leakage
As an earlier stabilizing measure, very short taps were not registered as such but discarded, potentially letting the touch information through as non-gesture events. This should rather be handled in utouch-frame, and thus the code his dropped here. [rydberg@euromail.se: folded in unused code removal] Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/gestures-tapping.c')
-rw-r--r--src/gestures-tapping.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/gestures-tapping.c b/src/gestures-tapping.c
index 6d71642..9abb6dc 100644
--- a/src/gestures-tapping.c
+++ b/src/gestures-tapping.c
@@ -23,9 +23,6 @@
23#include "grail-recognizer.h" 23#include "grail-recognizer.h"
24#include <math.h> 24#include <math.h>
25 25
26static const int TAP_MIN_GAP_MS = 25;
27static const int TAP_MIN_UP_MS = 200;
28
29static const int fm_mask = 0x07; 26static const int fm_mask = 0x07;
30 27
31static void set_props(const struct gesture_inserter *gin, 28static void set_props(const struct gesture_inserter *gin,
@@ -45,10 +42,7 @@ int gru_tapping(struct grail *ge,
45 struct gesture_recognizer *gru = ge->gru; 42 struct gesture_recognizer *gru = ge->gru;
46 struct tapping_model *state = &gru->tapping; 43 struct tapping_model *state = &gru->tapping;
47 struct move_model *move = &gru->move; 44 struct move_model *move = &gru->move;
48 grail_time_t up = move->time - state->end;
49 state->tap = 0; 45 state->tap = 0;
50 if (move->ntouch && move->ntouch < state->mintouch)
51 state->end = move->time;
52 if (move->ntouch > state->maxtouch) { 46 if (move->ntouch > state->maxtouch) {
53 if (state->active) { 47 if (state->active) {
54 gin_gid_discard(ge, state->gid); 48 gin_gid_discard(ge, state->gid);
@@ -73,8 +67,7 @@ int gru_tapping(struct grail *ge,
73 int x = state->prop[GRAIL_PROP_TAP_X]; 67 int x = state->prop[GRAIL_PROP_TAP_X];
74 int y = state->prop[GRAIL_PROP_TAP_Y]; 68 int y = state->prop[GRAIL_PROP_TAP_Y];
75 int t = move->time - state->start; 69 int t = move->time - state->start;
76 if (t < TAP_MIN_GAP_MS || t > move->fm[FM_X].bar_ms || 70 if (t > move->fm[FM_X].bar_ms) {
77 up < TAP_MIN_UP_MS) {
78 gin_gid_discard(ge, state->gid); 71 gin_gid_discard(ge, state->gid);
79 state->mintouch = move->ntouch; 72 state->mintouch = move->ntouch;
80 state->maxtouch = move->ntouch; 73 state->maxtouch = move->ntouch;