From 88dada465e0fad35b5a535a042e0a93046ffff7c Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Wed, 4 Aug 2010 22:06:54 +0200 Subject: Cleanup tapping and gesture code Improved tapping quality with this patch. Signed-off-by: Henrik Rydberg --- src/gestures-combo.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/gestures-combo.c') diff --git a/src/gestures-combo.c b/src/gestures-combo.c index 82e7b42..8b4ad8c 100644 --- a/src/gestures-combo.c +++ b/src/gestures-combo.c @@ -33,7 +33,7 @@ int gru_combo(struct grail *ge, struct combo_model *state = &gru->combo; struct move_model *move = &gru->move; grail_prop_t prop[DIM_GRAIL_PROP]; - if (!move->motion) { + if (!move->multi) { if (state->active) { gru_end(ge, state->gid, move); state->active = 0; @@ -44,16 +44,11 @@ int gru_combo(struct grail *ge, !move->r.tickle && !move->a.tickle) return 0; if (!state->active) { - switch(move->ntouch) { - case 2: - state->gid = gin_gid_begin(ge, GRAIL_TYPE_COMBO2, frame); - break; - case 3: - state->gid = gin_gid_begin(ge, GRAIL_TYPE_COMBO3, frame); - break; - default: + int type = move->ntouch == 2 ? GRAIL_TYPE_COMBO2 : + move->ntouch == 3 ? GRAIL_TYPE_COMBO3 : 0; + if (!type) return 0; - } + state->gid = gin_gid_begin(ge, type, PRIO_GESTURE, frame); state->active = 1; } if (!move->x.active && !move->y.active && -- cgit v1.2.3