From 58492d2cd0a38b0d26ea25bddead95bb0fe1c5ce Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Thu, 24 Feb 2011 11:58:57 +0100 Subject: Wait for the right number of fingers before gesture timeout A client listening only for multi-finger gestures will not get the chance to recognize unless there is a gesture timeout. This patch waits until the drag hold time has passed before releasing the touch. Signed-off-by: Henrik Rydberg --- src/grail-api.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/grail-api.c') diff --git a/src/grail-api.c b/src/grail-api.c index 6521f84..255c6c2 100644 --- a/src/grail-api.c +++ b/src/grail-api.c @@ -155,9 +155,11 @@ static void flush_gestures(struct grail *ge) static int gesture_timeout(struct grail *ge, const struct utouch_frame *frame) { + struct gesture_recognizer *gru = ge->gru; struct gesture_inserter *gin = ge->gin; - return grail_mask_count(gin->used, sizeof(gin->used)) == 0; + return grail_mask_count(gin->used, sizeof(gin->used)) == 0 && + frame->time - frame->mod_time > gru->move.fm[FM_X].hold_ms; } static void report_frame(struct grail *ge, -- cgit v1.2.3