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-rotate.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/gestures-rotate.c') diff --git a/src/gestures-rotate.c b/src/gestures-rotate.c index 011e9a0..90f9bdf 100644 --- a/src/gestures-rotate.c +++ b/src/gestures-rotate.c @@ -33,7 +33,7 @@ int gru_rotate(struct grail *ge, struct combo_model *state = &gru->rotate; 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; @@ -43,16 +43,11 @@ int gru_rotate(struct grail *ge, if (!move->a.tickle) return 0; if (!state->active) { - switch(move->ntouch) { - case 2: - state->gid = gin_gid_begin(ge, GRAIL_TYPE_ROTATE, frame); - break; - case 3: - state->gid = gin_gid_begin(ge, GRAIL_TYPE_TURN, frame); - break; - default: + int type = move->ntouch == 2 ? GRAIL_TYPE_ROTATE : + move->ntouch == 3 ? GRAIL_TYPE_TURN : 0; + if (!type) return 0; - } + state->gid = gin_gid_begin(ge, type, PRIO_GESTURE, frame); state->active = 1; } if (!move->a.active) -- cgit v1.2.3