summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/grail-api.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/grail-api.c b/src/grail-api.c
index 1a60a21..d0712b3 100644
--- a/src/grail-api.c
+++ b/src/grail-api.c
@@ -92,20 +92,27 @@ static int handle_abs_events(struct grail *ge,
92 return nevent; 92 return nevent;
93} 93}
94 94
95static int pointer_active(const struct grail *ge)
96{
97 static const int fm_mask = 0x03;
98 const struct move_model *move = &ge->gru->move;
99 const struct tapping_model *tap = &ge->gru->tapping;
100 return move->single && ((move->active & fm_mask) || tap->active);
101}
102
95static void tp_sync(struct touch_dev *dev, 103static void tp_sync(struct touch_dev *dev,
96 const struct input_event *syn) 104 const struct input_event *syn)
97{ 105{
98 struct input_event ev; 106 struct input_event ev;
99 struct grail *ge = dev->priv; 107 struct grail *ge = dev->priv;
100 struct grail_impl *impl = ge->impl; 108 struct grail_impl *impl = ge->impl;
101 struct gesture_recognizer *gru = ge->gru;
102 struct touch_frame *frame = &dev->frame; 109 struct touch_frame *frame = &dev->frame;
103 grail_mask_t filtered[DIM_EV_TYPE_BYTES]; 110 grail_mask_t filtered[DIM_EV_TYPE_BYTES];
104 int pointer, nevent = 0; 111 int pointer, nevent = 0;
105 gin_frame_begin(ge, frame); 112 gin_frame_begin(ge, frame);
106 gru_recognize(ge, frame); 113 gru_recognize(ge, frame);
107 gin_frame_end(ge, filtered, sizeof(filtered), frame); 114 gin_frame_end(ge, filtered, sizeof(filtered), frame);
108 pointer = gru->move.single && !grail_mask_get(filtered, EV_ABS); 115 pointer = pointer_active(ge) && !grail_mask_get(filtered, EV_ABS);
109 116
110 if (!ge->event) { 117 if (!ge->event) {
111 evbuf_clear(&impl->evbuf); 118 evbuf_clear(&impl->evbuf);