summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gestures-drag.c2
-rw-r--r--src/grail-api.c14
-rw-r--r--src/grail-recognizer.c5
-rw-r--r--src/grail-recognizer.h1
4 files changed, 13 insertions, 9 deletions
diff --git a/src/gestures-drag.c b/src/gestures-drag.c
index a02943e..b894bda 100644
--- a/src/gestures-drag.c
+++ b/src/gestures-drag.c
@@ -58,7 +58,7 @@ int gru_drag(struct grail *ge,
58 struct combo_model *state = &gru->drag; 58 struct combo_model *state = &gru->drag;
59 struct move_model *move = &gru->move; 59 struct move_model *move = &gru->move;
60 int mask = state->active ? (move->active & fm_mask) : fm_mask; 60 int mask = state->active ? (move->active & fm_mask) : fm_mask;
61 if (!move->multi && (!gru->pointer_gesture || !move->single)) { 61 if (!move->multi && !move->single) {
62 if (state->active) { 62 if (state->active) {
63 gru_end(ge, state->gid, move, 63 gru_end(ge, state->gid, move,
64 state->prop, state->nprop); 64 state->prop, state->nprop);
diff --git a/src/grail-api.c b/src/grail-api.c
index f7b664e..fbd0e83 100644
--- a/src/grail-api.c
+++ b/src/grail-api.c
@@ -35,6 +35,7 @@ struct grail_impl {
35 struct touch_dev dev; 35 struct touch_dev dev;
36 struct touch_engine engine; 36 struct touch_engine engine;
37 struct evbuf evbuf; 37 struct evbuf evbuf;
38 int filter_abs;
38}; 39};
39 40
40static void tp_event(struct touch_engine *engine, 41static void tp_event(struct touch_engine *engine,
@@ -51,19 +52,22 @@ static void tp_sync(struct touch_engine *engine,
51 struct input_event ev; 52 struct input_event ev;
52 struct grail *ge = engine->priv; 53 struct grail *ge = engine->priv;
53 struct grail_impl *x = ge->impl; 54 struct grail_impl *x = ge->impl;
55 struct gesture_recognizer *gru = ge->gru;
54 struct touch_frame *frame = &engine->frame; 56 struct touch_frame *frame = &engine->frame;
55 grail_mask_t filtered[DIM_EV_TYPE_BYTES]; 57 grail_mask_t filtered[DIM_EV_TYPE_BYTES];
56 int nevent = 0; 58 int dofilt, nevent = 0;
57 gin_frame_begin(ge, frame); 59 gin_frame_begin(ge, frame);
58 gru_recognize(ge, frame); 60 gru_recognize(ge, frame);
59 gin_frame_end(ge, filtered, sizeof(filtered), frame); 61 gin_frame_end(ge, filtered, sizeof(filtered), frame);
62 dofilt = gru->move.multi || gru->move.single && x->filter_abs;
63
60 if (!ge->event) { 64 if (!ge->event) {
61 evbuf_clear(&x->evbuf); 65 evbuf_clear(&x->evbuf);
62 return; 66 return;
63 } 67 }
64 while (!evbuf_empty(&x->evbuf)) { 68 while (!evbuf_empty(&x->evbuf)) {
65 evbuf_get(&x->evbuf, &ev); 69 evbuf_get(&x->evbuf, &ev);
66 if (grail_mask_get(filtered, ev.type)) 70 if (dofilt && grail_mask_get(filtered, ev.type))
67 continue; 71 continue;
68 ge->event(ge, &ev); 72 ge->event(ge, &ev);
69 nevent++; 73 nevent++;
@@ -72,6 +76,12 @@ static void tp_sync(struct touch_engine *engine,
72 ge->event(ge, syn); 76 ge->event(ge, syn);
73} 77}
74 78
79void grail_filter_abs_events(struct grail *ge, int usage)
80{
81 struct grail_impl *x = ge->impl;
82 x->filter_abs = usage;
83}
84
75int grail_open(struct grail *ge, int fd) 85int grail_open(struct grail *ge, int fd)
76{ 86{
77 struct grail_impl *x; 87 struct grail_impl *x;
diff --git a/src/grail-recognizer.c b/src/grail-recognizer.c
index 5f4bee0..fffbf6e 100644
--- a/src/grail-recognizer.c
+++ b/src/grail-recognizer.c
@@ -53,8 +53,3 @@ void gru_recognize(struct grail *ge, const struct touch_frame *frame)
53 gru_tapping(ge, frame); 53 gru_tapping(ge, frame);
54 ge->gru->frame = *frame; 54 ge->gru->frame = *frame;
55} 55}
56
57int gru_use_pointer_gesture(struct grail *ge, int usage)
58{
59 ge->gru->pointer_gesture = usage;
60}
diff --git a/src/grail-recognizer.h b/src/grail-recognizer.h
index 1c36819..b39eac3 100644
--- a/src/grail-recognizer.h
+++ b/src/grail-recognizer.h
@@ -32,7 +32,6 @@ struct gesture_recognizer {
32 struct combo_model pinch; 32 struct combo_model pinch;
33 struct combo_model rotate; 33 struct combo_model rotate;
34 struct tapping_model tapping; 34 struct tapping_model tapping;
35 int pointer_gesture;
36}; 35};
37 36
38int gru_init(struct grail *ge); 37int gru_init(struct grail *ge);