From 301cb7f95a4ca67b42410e65c71ddeefc379cb63 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Sat, 7 Aug 2010 20:47:56 +0200 Subject: Send proper begin/update/end status for gestures For transient gestures like taps, use update only. Signed-off-by: Henrik Rydberg --- src/grail-inserter.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/grail-inserter.c') 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, return; gev.type = s->type; gev.id = s->id; - gev.status = s->status; + gev.status = ev->status; gev.ntouch = ev->ntouch; gev.nprop = ev->nprop; gev.time = ev->time; @@ -238,7 +238,7 @@ void gin_gid_discard(struct grail *ge, int gid) void gin_gid_event(struct grail *ge, int gid, float x, float y, int ntouch, const grail_prop_t *prop, int nprop, - int status) + int transient) { struct gesture_inserter *gin = ge->gin; struct gesture_event ev; @@ -247,6 +247,7 @@ void gin_gid_event(struct grail *ge, int gid, if (i < 0) return; s = &gin->state[i]; + ev.status = transient ? GRAIL_STATUS_UPDATE : s->status; ev.ntouch = ntouch; ev.nprop = nprop; ev.time = gin->time; @@ -254,8 +255,10 @@ void gin_gid_event(struct grail *ge, int gid, ev.pos.y = y; memcpy(ev.prop, prop, nprop * sizeof(grail_prop_t)); gebuf_put(&s->buf, &ev); - if (s->status == GRAIL_STATUS_BEGIN) - s->status = status; + if (transient) + s->status = GRAIL_STATUS_END; + else if (s->status == GRAIL_STATUS_BEGIN) + s->status = GRAIL_STATUS_UPDATE; } void gin_gid_end(struct grail *ge, int gid, @@ -269,6 +272,7 @@ void gin_gid_end(struct grail *ge, int gid, return; s = &gin->state[i]; if (s->status != GRAIL_STATUS_BEGIN) { + ev.status = GRAIL_STATUS_END; ev.ntouch = ntouch; ev.nprop = 0; ev.time = gin->time; -- cgit v1.2.3