summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gestures-drag.c8
-rw-r--r--src/gestures-pinch.c8
-rw-r--r--src/gestures-rotate.c8
-rw-r--r--src/grail-inserter.c15
-rw-r--r--src/grail-inserter.h2
5 files changed, 23 insertions, 18 deletions
diff --git a/src/gestures-drag.c b/src/gestures-drag.c
index 9f2bcaf..962aa6d 100644
--- a/src/gestures-drag.c
+++ b/src/gestures-drag.c
@@ -74,10 +74,8 @@ int gru_drag(struct grail *ge,
74 } 74 }
75 if ((move->timeout & fm_mask) == fm_mask) { 75 if ((move->timeout & fm_mask) == fm_mask) {
76 if (state->active) { 76 if (state->active) {
77 gin_gid_discard(ge, state->gid); 77 gin_gid_timeout(ge, state->gid);
78 state->active = 0;
79 } 78 }
80 return 0;
81 } 79 }
82 if (!state->active) { 80 if (!state->active) {
83 int type = getype[move->ntouch]; 81 int type = getype[move->ntouch];
@@ -111,10 +109,8 @@ int gru_windrag(struct grail *ge,
111 } 109 }
112 if ((move->timeout & fm_mask) == fm_mask) { 110 if ((move->timeout & fm_mask) == fm_mask) {
113 if (state->active) { 111 if (state->active) {
114 gin_gid_discard(ge, state->gid); 112 gin_gid_timeout(ge, state->gid);
115 state->active = 0;
116 } 113 }
117 return 0;
118 } 114 }
119 if (!state->active) { 115 if (!state->active) {
120 if (move->ntouch == 4) { 116 if (move->ntouch == 4) {
diff --git a/src/gestures-pinch.c b/src/gestures-pinch.c
index 18772a0..bc5db1f 100644
--- a/src/gestures-pinch.c
+++ b/src/gestures-pinch.c
@@ -64,10 +64,8 @@ int gru_pinch(struct grail *ge,
64 } 64 }
65 if ((move->timeout & fm_mask) == fm_mask) { 65 if ((move->timeout & fm_mask) == fm_mask) {
66 if (state->active) { 66 if (state->active) {
67 gin_gid_discard(ge, state->gid); 67 gin_gid_timeout(ge, state->gid);
68 state->active = 0;
69 } 68 }
70 return 0;
71 } 69 }
72 if (!(move->tickle & mask)) 70 if (!(move->tickle & mask))
73 return 0; 71 return 0;
@@ -102,10 +100,8 @@ int gru_winpinch(struct grail *ge,
102 } 100 }
103 if ((move->timeout & fm_mask) == fm_mask) { 101 if ((move->timeout & fm_mask) == fm_mask) {
104 if (state->active) { 102 if (state->active) {
105 gin_gid_discard(ge, state->gid); 103 gin_gid_timeout(ge, state->gid);
106 state->active = 0;
107 } 104 }
108 return 0;
109 } 105 }
110 if (!(move->tickle & mask)) 106 if (!(move->tickle & mask))
111 return 0; 107 return 0;
diff --git a/src/gestures-rotate.c b/src/gestures-rotate.c
index 03e8f3c..0fff8a4 100644
--- a/src/gestures-rotate.c
+++ b/src/gestures-rotate.c
@@ -63,10 +63,8 @@ int gru_rotate(struct grail *ge,
63 } 63 }
64 if ((move->timeout & fm_mask) == fm_mask) { 64 if ((move->timeout & fm_mask) == fm_mask) {
65 if (state->active) { 65 if (state->active) {
66 gin_gid_discard(ge, state->gid); 66 gin_gid_timeout(ge, state->gid);
67 state->active = 0;
68 } 67 }
69 return 0;
70 } 68 }
71 if (!(move->tickle & mask)) 69 if (!(move->tickle & mask))
72 return 0; 70 return 0;
@@ -101,10 +99,8 @@ int gru_winrotate(struct grail *ge,
101 } 99 }
102 if ((move->timeout & fm_mask) == fm_mask) { 100 if ((move->timeout & fm_mask) == fm_mask) {
103 if (state->active) { 101 if (state->active) {
104 gin_gid_discard(ge, state->gid); 102 gin_gid_timeout(ge, state->gid);
105 state->active = 0;
106 } 103 }
107 return 0;
108 } 104 }
109 if (!(move->tickle & mask)) 105 if (!(move->tickle & mask))
110 return 0; 106 return 0;
diff --git a/src/grail-inserter.c b/src/grail-inserter.c
index 1ee8e5a..5225cb8 100644
--- a/src/grail-inserter.c
+++ b/src/grail-inserter.c
@@ -143,6 +143,13 @@ void gin_frame_end(struct grail *ge, const struct utouch_frame *frame)
143 143
144 grail_mask_foreach(i, gin->used, sizeof(gin->used)) { 144 grail_mask_foreach(i, gin->used, sizeof(gin->used)) {
145 struct slot_state *s = &gin->state[i]; 145 struct slot_state *s = &gin->state[i];
146 if (!s->timeout)
147 continue;
148 gin_gid_discard(ge, s->id);
149 }
150
151 grail_mask_foreach(i, gin->used, sizeof(gin->used)) {
152 struct slot_state *s = &gin->state[i];
146 struct gesture_event ev; 153 struct gesture_event ev;
147 grail_mask_set(gin->types, s->type); 154 grail_mask_set(gin->types, s->type);
148 if (s->priority < hold[s->slice]) 155 if (s->priority < hold[s->slice])
@@ -178,6 +185,7 @@ int gin_gid_begin(struct grail *ge, int type, int priority,
178 s->priority = priority; 185 s->priority = priority;
179 s->slice = 0; 186 s->slice = 0;
180 } 187 }
188 s->timeout = 0;
181 s->id = gin->gestureid++ & MAX_GESTURE_ID; 189 s->id = gin->gestureid++ & MAX_GESTURE_ID;
182 s->status = GRAIL_STATUS_BEGIN; 190 s->status = GRAIL_STATUS_BEGIN;
183 s->nclient = 0; 191 s->nclient = 0;
@@ -204,6 +212,13 @@ void gin_gid_discard(struct grail *ge, int gid)
204 grail_mask_set(gin->unused, i); 212 grail_mask_set(gin->unused, i);
205} 213}
206 214
215void gin_gid_timeout(struct grail *ge, int gid)
216{
217 int i = find_gslot(ge->gin, gid);
218 if (i >= 0)
219 ge->gin->state[i].timeout = 1;
220}
221
207void gin_gid_event(struct grail *ge, int gid, 222void gin_gid_event(struct grail *ge, int gid,
208 float x, float y, int ntouch, 223 float x, float y, int ntouch,
209 const grail_prop_t *prop, int nprop, 224 const grail_prop_t *prop, int nprop,
diff --git a/src/grail-inserter.h b/src/grail-inserter.h
index 12d0dc9..d1faa0a 100644
--- a/src/grail-inserter.h
+++ b/src/grail-inserter.h
@@ -38,6 +38,7 @@ struct slot_state {
38 int type; 38 int type;
39 int priority; 39 int priority;
40 int slice; 40 int slice;
41 int timeout;
41 int id; 42 int id;
42 int status; 43 int status;
43 int nclient; 44 int nclient;
@@ -91,6 +92,7 @@ void gin_frame_end(struct grail *ge, const struct utouch_frame *frame);
91int gin_gid_begin(struct grail *ge, int type, int priority, 92int gin_gid_begin(struct grail *ge, int type, int priority,
92 const struct utouch_frame *frame); 93 const struct utouch_frame *frame);
93void gin_gid_discard(struct grail *ge, int gid); 94void gin_gid_discard(struct grail *ge, int gid);
95void gin_gid_timeout(struct grail *ge, int gid);
94 96
95void gin_gid_event(struct grail *ge, int gid, 97void gin_gid_event(struct grail *ge, int gid,
96 float x, float y, int ntouch, 98 float x, float y, int ntouch,