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-pinch.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/gestures-pinch.c') diff --git a/src/gestures-pinch.c b/src/gestures-pinch.c index fa8a626..e022e8d 100644 --- a/src/gestures-pinch.c +++ b/src/gestures-pinch.c @@ -62,6 +62,13 @@ int gru_pinch(struct grail *ge, } return 0; } + if ((move->timeout & fm_mask) == fm_mask) { + if (state->active) { + gin_gid_discard(ge, state->gid); + state->active = 0; + } + return 0; + } if (!(move->tickle & mask)) return 0; if (!state->active) { @@ -93,6 +100,13 @@ int gru_winpinch(struct grail *ge, } return 0; } + if ((move->timeout & fm_mask) == fm_mask) { + if (state->active) { + gin_gid_discard(ge, state->gid); + state->active = 0; + } + return 0; + } if (!(move->tickle & mask)) return 0; if (!state->active) { -- cgit v1.2.3