From d0f7b524153d1b54128b049841f880ee78c2c529 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Tue, 21 Sep 2010 09:49:26 +0200 Subject: Simplify book-keeping of active gestures The current frame computation returns the event types to filter, which is less useful than knowing what gesture types are active in the frame. Add the active gesture types to the frame struct and simplify usage. Signed-off-by: Henrik Rydberg --- src/grail-api.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/grail-api.c') diff --git a/src/grail-api.c b/src/grail-api.c index d0712b3..0673120 100644 --- a/src/grail-api.c +++ b/src/grail-api.c @@ -106,13 +106,14 @@ static void tp_sync(struct touch_dev *dev, struct input_event ev; struct grail *ge = dev->priv; struct grail_impl *impl = ge->impl; + struct gesture_inserter *gin = ge->gin; struct touch_frame *frame = &dev->frame; - grail_mask_t filtered[DIM_EV_TYPE_BYTES]; - int pointer, nevent = 0; + int pointer, used_move, nevent = 0; gin_frame_begin(ge, frame); gru_recognize(ge, frame); - gin_frame_end(ge, filtered, sizeof(filtered), frame); - pointer = pointer_active(ge) && !grail_mask_get(filtered, EV_ABS); + gin_frame_end(ge, frame); + used_move = grail_mask_count(gin->types, sizeof(gin->types)); + pointer = pointer_active(ge) && !used_move; if (!ge->event) { evbuf_clear(&impl->evbuf); -- cgit v1.2.3