From f92c18c344c04a2501e01ae402441a92883da382 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Thu, 24 Feb 2011 23:38:01 +0100 Subject: Introduce gesture timeouts The timeout of a gesture is integral to the gesture type. This patch introduces timeout per gesture type, potentially enabling more control over gesture timing aspects. The timeout logic replaces the recently added recognition state. Signed-off-by: Henrik Rydberg --- src/gestures-drag.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/gestures-drag.c') diff --git a/src/gestures-drag.c b/src/gestures-drag.c index 05272da..9f2bcaf 100644 --- a/src/gestures-drag.c +++ b/src/gestures-drag.c @@ -72,6 +72,13 @@ int gru_drag(struct grail *ge, state->active = 0; } } + if ((move->timeout & fm_mask) == fm_mask) { + if (state->active) { + gin_gid_discard(ge, state->gid); + state->active = 0; + } + return 0; + } if (!state->active) { int type = getype[move->ntouch]; if (type < 0) @@ -102,6 +109,13 @@ int gru_windrag(struct grail *ge, state->active = 0; } } + if ((move->timeout & fm_mask) == fm_mask) { + if (state->active) { + gin_gid_discard(ge, state->gid); + state->active = 0; + } + return 0; + } if (!state->active) { if (move->ntouch == 4) { state->gid = gin_gid_begin(ge, GRAIL_TYPE_MDRAG, -- cgit v1.2.3