diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2011-02-24 22:04:47 +0100 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2011-03-14 12:55:20 +0100 |
| commit | a8e7fd4304f4ad5e23014a04ad95e4b799c58a53 (patch) | |
| tree | 97b03b565fd4ef261698836c1811ee794510d971 /src | |
| parent | 36df6f13da14e1f20c9d846fec5a6ec8c51d4937 (diff) | |
Reset tap state after timeout
A touch and hold will not properly reset the tap state, such that
the next tap fails to register. Fixed with this patch.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src')
| -rw-r--r-- | src/gestures-tapping.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gestures-tapping.c b/src/gestures-tapping.c index 9abb6dc..24ddf1a 100644 --- a/src/gestures-tapping.c +++ b/src/gestures-tapping.c | |||
| @@ -43,6 +43,10 @@ int gru_tapping(struct grail *ge, | |||
| 43 | struct tapping_model *state = &gru->tapping; | 43 | struct tapping_model *state = &gru->tapping; |
| 44 | struct move_model *move = &gru->move; | 44 | struct move_model *move = &gru->move; |
| 45 | state->tap = 0; | 45 | state->tap = 0; |
| 46 | if (frame->num_active && !frame->prev->num_active) { | ||
| 47 | state->mintouch = 0; | ||
| 48 | state->maxtouch = 0; | ||
| 49 | } | ||
| 46 | if (move->ntouch > state->maxtouch) { | 50 | if (move->ntouch > state->maxtouch) { |
| 47 | if (state->active) { | 51 | if (state->active) { |
| 48 | gin_gid_discard(ge, state->gid); | 52 | gin_gid_discard(ge, state->gid); |
| @@ -89,6 +93,8 @@ int gru_tapping(struct grail *ge, | |||
| 89 | if ((move->active & fm_mask) || | 93 | if ((move->active & fm_mask) || |
| 90 | move->time - state->start > move->fm[FM_X].bar_ms) { | 94 | move->time - state->start > move->fm[FM_X].bar_ms) { |
| 91 | gin_gid_discard(ge, state->gid); | 95 | gin_gid_discard(ge, state->gid); |
| 96 | state->mintouch = move->ntouch; | ||
| 97 | state->maxtouch = move->ntouch; | ||
| 92 | state->active = 0; | 98 | state->active = 0; |
| 93 | } | 99 | } |
| 94 | return 0; | 100 | return 0; |
