summaryrefslogtreecommitdiff
path: root/src/grail-inserter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/grail-inserter.c')
-rw-r--r--src/grail-inserter.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/grail-inserter.c b/src/grail-inserter.c
index 74a61b3..6ba9662 100644
--- a/src/grail-inserter.c
+++ b/src/grail-inserter.c
@@ -54,7 +54,7 @@ static void send_event(struct grail *ge, struct slot_state *s,
54 return; 54 return;
55 gev.type = s->type; 55 gev.type = s->type;
56 gev.id = s->id; 56 gev.id = s->id;
57 gev.status = s->status; 57 gev.status = ev->status;
58 gev.ntouch = ev->ntouch; 58 gev.ntouch = ev->ntouch;
59 gev.nprop = ev->nprop; 59 gev.nprop = ev->nprop;
60 gev.time = ev->time; 60 gev.time = ev->time;
@@ -238,7 +238,7 @@ void gin_gid_discard(struct grail *ge, int gid)
238void gin_gid_event(struct grail *ge, int gid, 238void gin_gid_event(struct grail *ge, int gid,
239 float x, float y, int ntouch, 239 float x, float y, int ntouch,
240 const grail_prop_t *prop, int nprop, 240 const grail_prop_t *prop, int nprop,
241 int status) 241 int transient)
242{ 242{
243 struct gesture_inserter *gin = ge->gin; 243 struct gesture_inserter *gin = ge->gin;
244 struct gesture_event ev; 244 struct gesture_event ev;
@@ -247,6 +247,7 @@ void gin_gid_event(struct grail *ge, int gid,
247 if (i < 0) 247 if (i < 0)
248 return; 248 return;
249 s = &gin->state[i]; 249 s = &gin->state[i];
250 ev.status = transient ? GRAIL_STATUS_UPDATE : s->status;
250 ev.ntouch = ntouch; 251 ev.ntouch = ntouch;
251 ev.nprop = nprop; 252 ev.nprop = nprop;
252 ev.time = gin->time; 253 ev.time = gin->time;
@@ -254,8 +255,10 @@ void gin_gid_event(struct grail *ge, int gid,
254 ev.pos.y = y; 255 ev.pos.y = y;
255 memcpy(ev.prop, prop, nprop * sizeof(grail_prop_t)); 256 memcpy(ev.prop, prop, nprop * sizeof(grail_prop_t));
256 gebuf_put(&s->buf, &ev); 257 gebuf_put(&s->buf, &ev);
257 if (s->status == GRAIL_STATUS_BEGIN) 258 if (transient)
258 s->status = status; 259 s->status = GRAIL_STATUS_END;
260 else if (s->status == GRAIL_STATUS_BEGIN)
261 s->status = GRAIL_STATUS_UPDATE;
259} 262}
260 263
261void gin_gid_end(struct grail *ge, int gid, 264void gin_gid_end(struct grail *ge, int gid,
@@ -269,6 +272,7 @@ void gin_gid_end(struct grail *ge, int gid,
269 return; 272 return;
270 s = &gin->state[i]; 273 s = &gin->state[i];
271 if (s->status != GRAIL_STATUS_BEGIN) { 274 if (s->status != GRAIL_STATUS_BEGIN) {
275 ev.status = GRAIL_STATUS_END;
272 ev.ntouch = ntouch; 276 ev.ntouch = ntouch;
273 ev.nprop = 0; 277 ev.nprop = 0;
274 ev.time = gin->time; 278 ev.time = gin->time;