summaryrefslogtreecommitdiff
path: root/src/gestures-pan.c
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-08-07 19:16:00 +0200
committerHenrik Rydberg <rydberg@euromail.se>2010-08-07 19:16:00 +0200
commitf6e65676026fa9f3f2664100b68ba2c6da376a24 (patch)
treed6a08fca5394c1cd75013a05aafd4af7943298cf /src/gestures-pan.c
parentee4a0c6821a1b79c3d18c6ef6d7ed6d37df74755 (diff)
Add configurable pointer gesture
In some applications, it is desirable to treat pointer movements as a gesture. This patch adds a gru configuration parameter which, then true, makes grail emit pointer gesture events. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/gestures-pan.c')
-rw-r--r--src/gestures-pan.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gestures-pan.c b/src/gestures-pan.c
index a023122..b8e1751 100644
--- a/src/gestures-pan.c
+++ b/src/gestures-pan.c
@@ -25,8 +25,8 @@
25#include <stdio.h> 25#include <stdio.h>
26 26
27static const int getype[DIM_TOUCH + 1] = { 27static const int getype[DIM_TOUCH + 1] = {
28 0, 28 -1,
29 0, 29 GRAIL_TYPE_POINTER,
30 GRAIL_TYPE_PAN, 30 GRAIL_TYPE_PAN,
31 GRAIL_TYPE_SWIPE, 31 GRAIL_TYPE_SWIPE,
32 GRAIL_TYPE_BRUSH, 32 GRAIL_TYPE_BRUSH,
@@ -43,7 +43,7 @@ int gru_pan(struct grail *ge,
43 struct move_model *move = &gru->move; 43 struct move_model *move = &gru->move;
44 grail_prop_t prop[DIM_GRAIL_PROP]; 44 grail_prop_t prop[DIM_GRAIL_PROP];
45 int mask = state->active ? (move->active & fm_mask) : fm_mask; 45 int mask = state->active ? (move->active & fm_mask) : fm_mask;
46 if (!move->multi) { 46 if (!move->multi && (!gru->pointer_gesture || !move->single)) {
47 if (state->active) { 47 if (state->active) {
48 gru_end(ge, state->gid, move); 48 gru_end(ge, state->gid, move);
49 state->active = 0; 49 state->active = 0;
@@ -54,7 +54,7 @@ int gru_pan(struct grail *ge,
54 return 0; 54 return 0;
55 if (!state->active) { 55 if (!state->active) {
56 int type = getype[move->ntouch]; 56 int type = getype[move->ntouch];
57 if (!type) 57 if (type < 0)
58 return 0; 58 return 0;
59 state->gid = gin_gid_begin(ge, type, PRIO_GESTURE, frame); 59 state->gid = gin_gid_begin(ge, type, PRIO_GESTURE, frame);
60 state->active = 1; 60 state->active = 1;