summaryrefslogtreecommitdiff
path: root/src/gestures-drag.c
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2011-02-24 23:38:01 +0100
committerHenrik Rydberg <rydberg@euromail.se>2011-03-14 12:55:19 +0100
commitf92c18c344c04a2501e01ae402441a92883da382 (patch)
treefec506ca8784002083babe767505930be2a8d25a /src/gestures-drag.c
parent609e367b3ee2b587f698b65393aa22357f453add (diff)
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 <rydberg@euromail.se>
Diffstat (limited to 'src/gestures-drag.c')
-rw-r--r--src/gestures-drag.c14
1 files changed, 14 insertions, 0 deletions
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,
72 state->active = 0; 72 state->active = 0;
73 } 73 }
74 } 74 }
75 if ((move->timeout & fm_mask) == fm_mask) {
76 if (state->active) {
77 gin_gid_discard(ge, state->gid);
78 state->active = 0;
79 }
80 return 0;
81 }
75 if (!state->active) { 82 if (!state->active) {
76 int type = getype[move->ntouch]; 83 int type = getype[move->ntouch];
77 if (type < 0) 84 if (type < 0)
@@ -102,6 +109,13 @@ int gru_windrag(struct grail *ge,
102 state->active = 0; 109 state->active = 0;
103 } 110 }
104 } 111 }
112 if ((move->timeout & fm_mask) == fm_mask) {
113 if (state->active) {
114 gin_gid_discard(ge, state->gid);
115 state->active = 0;
116 }
117 return 0;
118 }
105 if (!state->active) { 119 if (!state->active) {
106 if (move->ntouch == 4) { 120 if (move->ntouch == 4) {
107 state->gid = gin_gid_begin(ge, GRAIL_TYPE_MDRAG, 121 state->gid = gin_gid_begin(ge, GRAIL_TYPE_MDRAG,