summaryrefslogtreecommitdiff
path: root/src/grail-inserter.c
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2011-03-25 19:10:19 +0100
committerHenrik Rydberg <rydberg@euromail.se>2011-03-28 22:02:11 +0200
commit5d7ec311cdef842e60756d9189d09e3814e4ad1d (patch)
tree75eb532a7fb1b23744e11ad3c44790d4bbddd434 /src/grail-inserter.c
parenta0a4c6c30704a792193ff49d7fcaab63dac8a07a (diff)
Decouple timeout from discard
Move the actual gesture discard from the recognition phase to the instantiation phase. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/grail-inserter.c')
-rw-r--r--src/grail-inserter.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/grail-inserter.c b/src/grail-inserter.c
index 1ee8e5a..5225cb8 100644
--- a/src/grail-inserter.c
+++ b/src/grail-inserter.c
@@ -143,6 +143,13 @@ void gin_frame_end(struct grail *ge, const struct utouch_frame *frame)
143 143
144 grail_mask_foreach(i, gin->used, sizeof(gin->used)) { 144 grail_mask_foreach(i, gin->used, sizeof(gin->used)) {
145 struct slot_state *s = &gin->state[i]; 145 struct slot_state *s = &gin->state[i];
146 if (!s->timeout)
147 continue;
148 gin_gid_discard(ge, s->id);
149 }
150
151 grail_mask_foreach(i, gin->used, sizeof(gin->used)) {
152 struct slot_state *s = &gin->state[i];
146 struct gesture_event ev; 153 struct gesture_event ev;
147 grail_mask_set(gin->types, s->type); 154 grail_mask_set(gin->types, s->type);
148 if (s->priority < hold[s->slice]) 155 if (s->priority < hold[s->slice])
@@ -178,6 +185,7 @@ int gin_gid_begin(struct grail *ge, int type, int priority,
178 s->priority = priority; 185 s->priority = priority;
179 s->slice = 0; 186 s->slice = 0;
180 } 187 }
188 s->timeout = 0;
181 s->id = gin->gestureid++ & MAX_GESTURE_ID; 189 s->id = gin->gestureid++ & MAX_GESTURE_ID;
182 s->status = GRAIL_STATUS_BEGIN; 190 s->status = GRAIL_STATUS_BEGIN;
183 s->nclient = 0; 191 s->nclient = 0;
@@ -204,6 +212,13 @@ void gin_gid_discard(struct grail *ge, int gid)
204 grail_mask_set(gin->unused, i); 212 grail_mask_set(gin->unused, i);
205} 213}
206 214
215void gin_gid_timeout(struct grail *ge, int gid)
216{
217 int i = find_gslot(ge->gin, gid);
218 if (i >= 0)
219 ge->gin->state[i].timeout = 1;
220}
221
207void gin_gid_event(struct grail *ge, int gid, 222void gin_gid_event(struct grail *ge, int gid,
208 float x, float y, int ntouch, 223 float x, float y, int ntouch,
209 const grail_prop_t *prop, int nprop, 224 const grail_prop_t *prop, int nprop,