From 11ce60e63da0c632e4c06e212a3add7d53cbf658 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Tue, 10 Aug 2010 16:48:39 +0100 Subject: Make tapping position appear properly Signed-off-by: Henrik Rydberg --- src/gestures-tapping.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/gestures-tapping.c') diff --git a/src/gestures-tapping.c b/src/gestures-tapping.c index 0deacf8..52c5fdb 100644 --- a/src/gestures-tapping.c +++ b/src/gestures-tapping.c @@ -37,13 +37,19 @@ int gru_tapping(struct grail *ge, struct gesture_recognizer *gru = ge->gru; struct tapping_model *state = &gru->tapping; struct move_model *move = &gru->move; - grail_prop_t prop[DIM_GRAIL_PROP]; if (move->ntouch) { if (state->status == TAP_CANCEL) return 0; state->status = TAP_BEGIN; if (!state->ntouch) state->start = move->time; + if (move->ntouch >= state->ntouch) { + state->prop[GRAIL_PROP_TAP_DT] = + move->time - state->start; + state->prop[GRAIL_PROP_TAP_X] = move->fm[FM_X].value; + state->prop[GRAIL_PROP_TAP_Y] = move->fm[FM_Y].value; + state->nprop = 3; + } if (move->ntouch > state->ntouch) { state->ntouch = move->ntouch; if (state->active) { @@ -83,10 +89,11 @@ int gru_tapping(struct grail *ge, if (state->status != TAP_END || move->time - state->start < TAP_MIN_GAP_MS) return 0; - prop[GRAIL_PROP_TAP_DT] = move->time - state->start; + state->prop[GRAIL_PROP_TAP_DT] = move->time - state->start; gin_gid_event(ge, state->gid, - move->fm[FM_X].value, move->fm[FM_Y].value, state->ntouch, - prop, 1, 1); + state->prop[GRAIL_PROP_TAP_X], + state->prop[GRAIL_PROP_TAP_Y], state->ntouch, + state->prop, state->nprop, 1); state->status = TAP_BEGIN; state->ntouch = 0; state->active = 0; -- cgit v1.2.3