Merge lp:~oif-packaging/grail/packaging.touch-gestures into lp:grail/ubuntu
- packaging.touch-gestures
- Merge into packaging
Proposed by
Chase Douglas
Status: | Merged |
---|---|
Merged at revision: | 79 |
Proposed branch: | lp:~oif-packaging/grail/packaging.touch-gestures |
Merge into: | lp:grail/ubuntu |
Diff against target: |
645 lines (+612/-0) 6 files modified
debian/changelog (+14/-0) debian/patches/0001-set-proper-tap-properties.patch (+13/-0) debian/patches/0002-disable-semi-mt-rotation.patch (+25/-0) debian/patches/0003-add-touch-gestures.patch (+508/-0) debian/patches/0004-dont-hold-back-active-gestures.patch (+48/-0) debian/patches/series (+4/-0) |
To merge this branch: | bzr merge lp:~oif-packaging/grail/packaging.touch-gestures |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Duncan McGreggor (community) | Approve | ||
Henrik Rydberg (community) | Approve | ||
Review via email: mp+55235@code.launchpad.net |
Commit message
Description of the change
Includes three patches for the associated bugs:
* Prevent semi-mt rotation
* Add touch gestures
* Ensure gesture end events are sent
To post a comment you must log in.
- 84. By Chase Douglas
-
Fold in related fix to 0004-dont-
hold-back- active- gestures. patch
Revision history for this message
Duncan McGreggor (oubiwann) wrote : | # |
I'm okay with bad style, if it's a bug fix. I can't think of a reason not to include this bug fix, so I'm +1'ing it.
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/changelog' |
2 | --- debian/changelog 2011-03-09 17:14:52 +0000 |
3 | +++ debian/changelog 2011-03-30 15:42:36 +0000 |
4 | @@ -1,3 +1,17 @@ |
5 | +utouch-grail (1.0.20-0ubuntu3) UNRELEASED; urgency=low |
6 | + |
7 | + * Prevent rotation gestures on semi-mt trackpads (LP: #724979) |
8 | + * Add touch gestures (LP: #742582) |
9 | + * Ensure all started gestures end (LP: #744391) |
10 | + |
11 | + -- Chase Douglas <chase.douglas@ubuntu.com> Mon, 28 Mar 2011 16:19:49 -0400 |
12 | + |
13 | +utouch-grail (1.0.20-0ubuntu2) natty; urgency=low |
14 | + |
15 | + * Show all properties on multitouch taps (LP: #742006) |
16 | + |
17 | + -- Chase Douglas <chase.douglas@ubuntu.com> Thu, 24 Mar 2011 17:50:30 -0400 |
18 | + |
19 | utouch-grail (1.0.20-0ubuntu1) natty; urgency=low |
20 | |
21 | [ Henrik Rydberg ] |
22 | |
23 | === added directory 'debian/patches' |
24 | === added file 'debian/patches/0001-set-proper-tap-properties.patch' |
25 | --- debian/patches/0001-set-proper-tap-properties.patch 1970-01-01 00:00:00 +0000 |
26 | +++ debian/patches/0001-set-proper-tap-properties.patch 2011-03-30 15:42:36 +0000 |
27 | @@ -0,0 +1,13 @@ |
28 | +=== modified file 'src/gestures-tapping.c' |
29 | +--- a/src/gestures-tapping.c 2011-03-17 09:48:13 +0000 |
30 | ++++ b/src/gestures-tapping.c 2011-03-24 19:52:47 +0000 |
31 | +@@ -89,7 +89,7 @@ |
32 | + } |
33 | + if (!move->ntouch) |
34 | + return 0; |
35 | +- set_props(ge->gin, state, move, frame); |
36 | ++ state->prop[GRAIL_PROP_TAP_DT] = move->time - state->start; |
37 | + if ((move->active & fm_mask) || |
38 | + move->time - state->start > move->fm[FM_X].bar_ms) { |
39 | + gin_gid_discard(ge, state->gid); |
40 | + |
41 | |
42 | === added file 'debian/patches/0002-disable-semi-mt-rotation.patch' |
43 | --- debian/patches/0002-disable-semi-mt-rotation.patch 1970-01-01 00:00:00 +0000 |
44 | +++ debian/patches/0002-disable-semi-mt-rotation.patch 2011-03-30 15:42:36 +0000 |
45 | @@ -0,0 +1,25 @@ |
46 | +=== modified file 'src/grail-gestures.c' |
47 | +--- a/src/grail-gestures.c 2011-02-24 22:50:31 +0000 |
48 | ++++ b/src/grail-gestures.c 2011-03-17 09:43:52 +0000 |
49 | +@@ -167,6 +167,7 @@ |
50 | + void gru_motion(struct grail *ge, |
51 | + const struct utouch_frame *frame) |
52 | + { |
53 | ++ const struct utouch_surface *s = utouch_frame_get_surface(ge->impl->fh); |
54 | + struct gesture_recognizer *gru = ge->gru; |
55 | + struct move_model *m = &gru->move; |
56 | + grail_time_t t = frame->time; |
57 | +@@ -197,8 +198,10 @@ |
58 | + r = compute_radius(x, y, frame); |
59 | + r = move_filter(&m->fm[FM_R], r); |
60 | + a = m->fm[FM_A].value; |
61 | +- a += compute_rotation(x, y, r, frame); |
62 | +- a = move_filter(&m->fm[FM_A], a); |
63 | ++ if (!s->is_semi_mt) { |
64 | ++ a += compute_rotation(x, y, r, frame); |
65 | ++ a = move_filter(&m->fm[FM_A], a); |
66 | ++ } |
67 | + move_update(m, FM_X, x, t); |
68 | + move_update(m, FM_Y, y, t); |
69 | + move_update(m, FM_R, r, t); |
70 | + |
71 | |
72 | === added file 'debian/patches/0003-add-touch-gestures.patch' |
73 | --- debian/patches/0003-add-touch-gestures.patch 1970-01-01 00:00:00 +0000 |
74 | +++ debian/patches/0003-add-touch-gestures.patch 2011-03-30 15:42:36 +0000 |
75 | @@ -0,0 +1,508 @@ |
76 | +=== modified file 'include/grail-types.h' |
77 | +--- a/include/grail-types.h 2010-08-19 20:36:11 +0000 |
78 | ++++ b/include/grail-types.h 2011-03-28 20:04:07 +0000 |
79 | +@@ -59,11 +59,20 @@ |
80 | + |
81 | + #define GRAIL_TYPE_SYSFLAG1 26 /* reserved system flag */ |
82 | + |
83 | ++#define GRAIL_TYPE_TOUCH1 32 /* one-finger touch */ |
84 | ++#define GRAIL_TYPE_TOUCH2 33 /* two-finger touch */ |
85 | ++#define GRAIL_TYPE_TOUCH3 34 /* three-finger touch */ |
86 | ++#define GRAIL_TYPE_TOUCH4 35 /* four-finger touch */ |
87 | ++#define GRAIL_TYPE_TOUCH5 36 /* five-finger touch */ |
88 | ++#define GRAIL_TYPE_ETOUCH 37 /* three-finger environment touch */ |
89 | ++#define GRAIL_TYPE_MTOUCH 38 /* four-finger meta touch */ |
90 | ++ |
91 | + #define GRAIL_MAIN_DRAG 0 |
92 | + #define GRAIL_MAIN_PINCH 1 |
93 | + #define GRAIL_MAIN_ROTATE 2 |
94 | + #define GRAIL_MAIN_TAP 3 |
95 | + #define GRAIL_MAIN_SYSFLAG 4 |
96 | ++#define GRAIL_MAIN_TOUCH 5 |
97 | + |
98 | + #define GRAIL_PROP_DRAG_DX 0 /* horizontal position delta */ |
99 | + #define GRAIL_PROP_DRAG_DY 1 /* vertical position delta */ |
100 | +@@ -160,5 +169,24 @@ |
101 | + #define GRAIL_PROP_TAP_X_T4 20 |
102 | + #define GRAIL_PROP_TAP_Y_T4 21 |
103 | + |
104 | ++#define GRAIL_PROP_TOUCH_X1 0 /* bounding box x1 */ |
105 | ++#define GRAIL_PROP_TOUCH_Y1 1 /* bounding box y1 */ |
106 | ++#define GRAIL_PROP_TOUCH_X2 2 /* bounding box x2 */ |
107 | ++#define GRAIL_PROP_TOUCH_Y2 3 /* bounding box y2 */ |
108 | ++#define GRAIL_PROP_TOUCH_ID_T0 4 /* first touch id */ |
109 | ++#define GRAIL_PROP_TOUCH_X_T0 5 /* first touch horizontal position */ |
110 | ++#define GRAIL_PROP_TOUCH_Y_T0 6 /* first touch vertical position */ |
111 | ++#define GRAIL_PROP_TOUCH_ID_T1 7 |
112 | ++#define GRAIL_PROP_TOUCH_X_T1 8 |
113 | ++#define GRAIL_PROP_TOUCH_Y_T1 9 |
114 | ++#define GRAIL_PROP_TOUCH_ID_T2 10 |
115 | ++#define GRAIL_PROP_TOUCH_X_T2 11 |
116 | ++#define GRAIL_PROP_TOUCH_Y_T2 12 |
117 | ++#define GRAIL_PROP_TOUCH_ID_T3 13 |
118 | ++#define GRAIL_PROP_TOUCH_X_T3 14 |
119 | ++#define GRAIL_PROP_TOUCH_Y_T3 15 |
120 | ++#define GRAIL_PROP_TOUCH_ID_T4 16 |
121 | ++#define GRAIL_PROP_TOUCH_X_T4 17 |
122 | ++#define GRAIL_PROP_TOUCH_Y_T4 18 |
123 | + |
124 | + #endif |
125 | + |
126 | +=== modified file 'src/Makefile.am' |
127 | +--- a/src/Makefile.am 2011-01-02 12:08:42 +0000 |
128 | ++++ b/src/Makefile.am 2011-03-28 20:04:07 +0000 |
129 | +@@ -17,6 +17,7 @@ |
130 | + grail-inserter.h \ |
131 | + grail-gestures.c \ |
132 | + grail-gestures.h \ |
133 | ++ gestures-touch.c \ |
134 | + gestures-drag.c \ |
135 | + gestures-pinch.c \ |
136 | + gestures-rotate.c \ |
137 | + |
138 | +=== modified file 'src/Makefile.in' |
139 | +--- a/src/Makefile.in 2011-01-03 16:00:56 +0000 |
140 | ++++ b/src/Makefile.in 2011-03-28 20:48:57 +0000 |
141 | +@@ -72,9 +72,9 @@ |
142 | + LTLIBRARIES = $(lib_LTLIBRARIES) |
143 | + libutouch_grail_la_LIBADD = |
144 | + am_libutouch_grail_la_OBJECTS = grail-bits.lo grail-inserter.lo \ |
145 | +- grail-gestures.lo gestures-drag.lo gestures-pinch.lo \ |
146 | +- gestures-rotate.lo gestures-tapping.lo grail-recognizer.lo \ |
147 | +- grail-event.lo grail-api.lo |
148 | ++ grail-gestures.lo gestures-touch.lo gestures-drag.lo \ |
149 | ++ gestures-pinch.lo gestures-rotate.lo gestures-tapping.lo \ |
150 | ++ grail-recognizer.lo grail-event.lo grail-api.lo |
151 | + libutouch_grail_la_OBJECTS = $(am_libutouch_grail_la_OBJECTS) |
152 | + libutouch_grail_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ |
153 | + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ |
154 | +@@ -238,6 +238,7 @@ |
155 | + grail-inserter.h \ |
156 | + grail-gestures.c \ |
157 | + grail-gestures.h \ |
158 | ++ gestures-touch.c \ |
159 | + gestures-drag.c \ |
160 | + gestures-pinch.c \ |
161 | + gestures-rotate.c \ |
162 | +@@ -334,6 +335,7 @@ |
163 | + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gestures-pinch.Plo@am__quote@ |
164 | + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gestures-rotate.Plo@am__quote@ |
165 | + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gestures-tapping.Plo@am__quote@ |
166 | ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gestures-touch.Plo@am__quote@ |
167 | + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grail-api.Plo@am__quote@ |
168 | + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grail-bits.Plo@am__quote@ |
169 | + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grail-event.Plo@am__quote@ |
170 | + |
171 | +=== modified file 'src/gestures-drag.c' |
172 | +--- a/src/gestures-drag.c 2011-03-17 09:48:13 +0000 |
173 | ++++ b/src/gestures-drag.c 2011-03-28 20:04:18 +0000 |
174 | +@@ -70,10 +70,8 @@ |
175 | + } |
176 | + if ((move->timeout & fm_mask) == fm_mask) { |
177 | + if (state->active) { |
178 | +- gin_gid_discard(ge, state->gid); |
179 | +- state->active = 0; |
180 | ++ gin_gid_timeout(ge, state->gid); |
181 | + } |
182 | +- return 0; |
183 | + } |
184 | + if (!state->active) { |
185 | + int type = getype[move->ntouch]; |
186 | +@@ -84,7 +82,7 @@ |
187 | + } |
188 | + if (!(move->tickle & mask)) |
189 | + return 0; |
190 | +- if (!move->single && !(move->active & fm_mask)) |
191 | ++ if (!(move->active & fm_mask)) |
192 | + return 0; |
193 | + set_props(ge->gin, state, move, frame); |
194 | + gru_event(ge, state->gid, move, state->prop, state->nprop); |
195 | +@@ -107,10 +105,8 @@ |
196 | + } |
197 | + if ((move->timeout & fm_mask) == fm_mask) { |
198 | + if (state->active) { |
199 | +- gin_gid_discard(ge, state->gid); |
200 | +- state->active = 0; |
201 | ++ gin_gid_timeout(ge, state->gid); |
202 | + } |
203 | +- return 0; |
204 | + } |
205 | + if (!state->active) { |
206 | + if (move->ntouch == 4) { |
207 | +@@ -131,7 +127,7 @@ |
208 | + } |
209 | + if (!(move->tickle & mask)) |
210 | + return 0; |
211 | +- if (!move->single && !(move->active & fm_mask)) |
212 | ++ if (!(move->active & fm_mask)) |
213 | + return 0; |
214 | + set_props(ge->gin, state, move, frame); |
215 | + gru_event(ge, state->gid, move, state->prop, state->nprop); |
216 | + |
217 | +=== modified file 'src/gestures-pinch.c' |
218 | +--- a/src/gestures-pinch.c 2011-03-17 09:48:13 +0000 |
219 | ++++ b/src/gestures-pinch.c 2011-03-28 20:04:11 +0000 |
220 | +@@ -64,10 +64,8 @@ |
221 | + } |
222 | + if ((move->timeout & fm_mask) == fm_mask) { |
223 | + if (state->active) { |
224 | +- gin_gid_discard(ge, state->gid); |
225 | +- state->active = 0; |
226 | ++ gin_gid_timeout(ge, state->gid); |
227 | + } |
228 | +- return 0; |
229 | + } |
230 | + if (!(move->tickle & mask)) |
231 | + return 0; |
232 | +@@ -102,10 +100,8 @@ |
233 | + } |
234 | + if ((move->timeout & fm_mask) == fm_mask) { |
235 | + if (state->active) { |
236 | +- gin_gid_discard(ge, state->gid); |
237 | +- state->active = 0; |
238 | ++ gin_gid_timeout(ge, state->gid); |
239 | + } |
240 | +- return 0; |
241 | + } |
242 | + if (!(move->tickle & mask)) |
243 | + return 0; |
244 | + |
245 | +=== modified file 'src/gestures-rotate.c' |
246 | +--- a/src/gestures-rotate.c 2011-02-24 22:51:33 +0000 |
247 | ++++ b/src/gestures-rotate.c 2011-03-28 20:04:11 +0000 |
248 | +@@ -63,10 +63,8 @@ |
249 | + } |
250 | + if ((move->timeout & fm_mask) == fm_mask) { |
251 | + if (state->active) { |
252 | +- gin_gid_discard(ge, state->gid); |
253 | +- state->active = 0; |
254 | ++ gin_gid_timeout(ge, state->gid); |
255 | + } |
256 | +- return 0; |
257 | + } |
258 | + if (!(move->tickle & mask)) |
259 | + return 0; |
260 | +@@ -101,10 +99,8 @@ |
261 | + } |
262 | + if ((move->timeout & fm_mask) == fm_mask) { |
263 | + if (state->active) { |
264 | +- gin_gid_discard(ge, state->gid); |
265 | +- state->active = 0; |
266 | ++ gin_gid_timeout(ge, state->gid); |
267 | + } |
268 | +- return 0; |
269 | + } |
270 | + if (!(move->tickle & mask)) |
271 | + return 0; |
272 | + |
273 | +=== added file 'src/gestures-touch.c' |
274 | +--- a/src/gestures-touch.c 1970-01-01 00:00:00 +0000 |
275 | ++++ b/src/gestures-touch.c 2011-03-28 20:04:07 +0000 |
276 | +@@ -0,0 +1,94 @@ |
277 | ++/***************************************************************************** |
278 | ++ * |
279 | ++ * grail - Gesture Recognition And Instantiation Library |
280 | ++ * |
281 | ++ * Copyright (C) 2010 Canonical Ltd. |
282 | ++ * Copyright (C) 2010 Henrik Rydberg <rydberg@bitmath.org> |
283 | ++ * |
284 | ++ * This program is free software: you can redistribute it and/or modify it |
285 | ++ * under the terms of the GNU General Public License as published by the |
286 | ++ * Free Software Foundation, either version 3 of the License, or (at your |
287 | ++ * option) any later version. |
288 | ++ * |
289 | ++ * This program is distributed in the hope that it will be useful, but |
290 | ++ * WITHOUT ANY WARRANTY; without even the implied warranty of |
291 | ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
292 | ++ * General Public License for more details. |
293 | ++ * |
294 | ++ * You should have received a copy of the GNU General Public License along |
295 | ++ * with this program. If not, see <http://www.gnu.org/licenses/>. |
296 | ++ * |
297 | ++ ****************************************************************************/ |
298 | ++ |
299 | ++#include "grail-recognizer.h" |
300 | ++#include <math.h> |
301 | ++#include <stdio.h> |
302 | ++ |
303 | ++static const int getype[DIM_TOUCH + 1] = { |
304 | ++ -1, |
305 | ++ GRAIL_TYPE_TOUCH1, |
306 | ++ GRAIL_TYPE_TOUCH2, |
307 | ++ GRAIL_TYPE_TOUCH3, |
308 | ++ GRAIL_TYPE_TOUCH4, |
309 | ++ GRAIL_TYPE_TOUCH5, |
310 | ++}; |
311 | ++ |
312 | ++int gru_touch(struct grail *ge, |
313 | ++ const struct utouch_frame *frame) |
314 | ++{ |
315 | ++ struct gesture_recognizer *gru = ge->gru; |
316 | ++ struct combo_model *state = &gru->touch; |
317 | ++ struct move_model *move = &gru->move; |
318 | ++ if (frame->slot_revision != frame->prev->slot_revision) { |
319 | ++ if (state->active) { |
320 | ++ gru_end(ge, state->gid, move, |
321 | ++ state->prop, state->nprop); |
322 | ++ state->active = 0; |
323 | ++ } |
324 | ++ } |
325 | ++ if (!state->active) { |
326 | ++ int type = getype[move->ntouch]; |
327 | ++ if (type <= 0) |
328 | ++ return 0; |
329 | ++ state->gid = gin_gid_begin(ge, type, -PRIO_GESTURE, frame); |
330 | ++ state->active = 1; |
331 | ++ } |
332 | ++ state->nprop = gin_add_contact_props(ge->gin, state->prop, frame); |
333 | ++ gru_event(ge, state->gid, move, state->prop, state->nprop); |
334 | ++ return 1; |
335 | ++} |
336 | ++ |
337 | ++int gru_wintouch(struct grail *ge, |
338 | ++ const struct utouch_frame *frame) |
339 | ++{ |
340 | ++ struct gesture_recognizer *gru = ge->gru; |
341 | ++ struct combo_model *state = &gru->wintouch; |
342 | ++ struct move_model *move = &gru->move; |
343 | ++ if (frame->slot_revision != frame->prev->slot_revision) { |
344 | ++ if (state->active && out_of_bounds(state, move)) { |
345 | ++ gru_end(ge, state->gid, move, |
346 | ++ state->prop, state->nprop); |
347 | ++ state->active = 0; |
348 | ++ } |
349 | ++ } |
350 | ++ if (!state->active) { |
351 | ++ if (move->ntouch == 4) { |
352 | ++ state->gid = gin_gid_begin(ge, GRAIL_TYPE_MTOUCH, |
353 | ++ -PRIO_META, frame); |
354 | ++ state->mintouch = 1; |
355 | ++ state->maxtouch = 4; |
356 | ++ state->active = 1; |
357 | ++ } else if (move->ntouch == 3) { |
358 | ++ state->gid = gin_gid_begin(ge, GRAIL_TYPE_ETOUCH, |
359 | ++ -PRIO_ENV, frame); |
360 | ++ state->mintouch = 1; |
361 | ++ state->maxtouch = 3; |
362 | ++ state->active = 1; |
363 | ++ } else { |
364 | ++ return 0; |
365 | ++ } |
366 | ++ } |
367 | ++ state->nprop = gin_add_contact_props(ge->gin, state->prop, frame); |
368 | ++ gru_event(ge, state->gid, move, state->prop, state->nprop); |
369 | ++ return 1; |
370 | ++} |
371 | + |
372 | +=== modified file 'src/grail-gestures.c' |
373 | +--- a/src/grail-gestures.c 2011-03-17 09:48:13 +0000 |
374 | ++++ b/src/grail-gestures.c 2011-03-28 20:04:16 +0000 |
375 | +@@ -133,15 +133,14 @@ |
376 | + m->tickle &= ~(1 << i); |
377 | + if (m->active & (1 << i)) |
378 | + return; |
379 | +- fm->action_delta = x - fm->original; |
380 | +- if (t - fm->original_ms > fm->hold_ms && |
381 | +- fabs(fm->action_delta) > fm->bar) { |
382 | +- m->active |= (1 << i); |
383 | ++ fm->action_delta = 0; |
384 | ++ if (fabs(x - fm->original) > fm->bar) { |
385 | ++ if (t - fm->original_ms > fm->hold_ms) { |
386 | ++ m->active |= (1 << i); |
387 | ++ fm->action_delta = x - fm->original; |
388 | ++ } |
389 | + } else if (t - fm->original_ms > fm->bar_ms) { |
390 | +- m->active |= (1 << i); |
391 | + m->timeout |= (1 << i); |
392 | +- } else { |
393 | +- fm->action_delta = 0; |
394 | + } |
395 | + } |
396 | + |
397 | + |
398 | +=== modified file 'src/grail-gestures.h' |
399 | +--- a/src/grail-gestures.h 2011-02-24 22:51:17 +0000 |
400 | ++++ b/src/grail-gestures.h 2011-03-28 20:04:07 +0000 |
401 | +@@ -77,6 +77,8 @@ |
402 | + grail_prop_t prop[DIM_GRAIL_PROP]; |
403 | + }; |
404 | + |
405 | ++int gru_touch(struct grail *ge, |
406 | ++ const struct utouch_frame *frame); |
407 | + int gru_drag(struct grail *ge, |
408 | + const struct utouch_frame *frame); |
409 | + int gru_pinch(struct grail *ge, |
410 | +@@ -90,6 +92,8 @@ |
411 | + return m->ntouch < s->mintouch || m->ntouch > s->maxtouch; |
412 | + } |
413 | + |
414 | ++int gru_wintouch(struct grail *ge, |
415 | ++ const struct utouch_frame *frame); |
416 | + int gru_windrag(struct grail *ge, |
417 | + const struct utouch_frame *frame); |
418 | + int gru_winpinch(struct grail *ge, |
419 | + |
420 | +=== modified file 'src/grail-inserter.c' |
421 | +--- a/src/grail-inserter.c 2011-03-17 09:48:13 +0000 |
422 | ++++ b/src/grail-inserter.c 2011-03-28 20:04:13 +0000 |
423 | +@@ -38,6 +38,18 @@ |
424 | + return -1; |
425 | + } |
426 | + |
427 | ++static int mask_overlap(const grail_mask_t *a, const grail_mask_t *b, |
428 | ++ int bytes) |
429 | ++{ |
430 | ++ int i; |
431 | ++ |
432 | ++ for (i = 0; i < bytes; i++) |
433 | ++ if (a[i] & b[i]) |
434 | ++ return 1; |
435 | ++ |
436 | ++ return 0; |
437 | ++} |
438 | ++ |
439 | + // todo: spanning tree for multi-user case |
440 | + static void setup_new_gestures(struct grail *ge, |
441 | + const struct utouch_frame *frame) |
442 | +@@ -114,33 +126,50 @@ |
443 | + void gin_frame_end(struct grail *ge, const struct utouch_frame *frame) |
444 | + { |
445 | + struct gesture_inserter *gin = ge->gin; |
446 | +- int i, hold = 0, discard = 0; |
447 | ++ grail_mask_t keep[DIM_TOUCH_BYTES]; |
448 | ++ int i, hold[2] = { 0, 0 }, discard[2] = { 0, 0 }; |
449 | + |
450 | ++ memset(keep, 0, sizeof(keep)); |
451 | + setup_new_gestures(ge, frame); |
452 | + |
453 | + grail_mask_foreach(i, gin->used, sizeof(gin->used)) { |
454 | + struct slot_state *s = &gin->state[i]; |
455 | + if (!s->nclient) |
456 | + continue; |
457 | +- if (s->priority > hold) |
458 | +- hold = s->priority; |
459 | ++ if (s->priority > hold[s->slice]) |
460 | ++ hold[s->slice] = s->priority; |
461 | + if (s->status != GRAIL_STATUS_UPDATE) |
462 | + continue; |
463 | +- if (s->priority > discard) |
464 | +- discard = s->priority; |
465 | ++ if (s->priority > discard[s->slice]) |
466 | ++ discard[s->slice] = s->priority; |
467 | + } |
468 | + |
469 | + grail_mask_foreach(i, gin->used, sizeof(gin->used)) { |
470 | + struct slot_state *s = &gin->state[i]; |
471 | +- if (!s->nclient || s->priority < discard) |
472 | ++ if (!s->nclient || s->priority < discard[s->slice]) |
473 | + gin_gid_discard(ge, s->id); |
474 | + } |
475 | + |
476 | + grail_mask_foreach(i, gin->used, sizeof(gin->used)) { |
477 | + struct slot_state *s = &gin->state[i]; |
478 | ++ if (s->slice == 1) |
479 | ++ grail_mask_set_mask(keep, s->span, sizeof(keep)); |
480 | ++ } |
481 | ++ |
482 | ++ grail_mask_foreach(i, gin->used, sizeof(gin->used)) { |
483 | ++ struct slot_state *s = &gin->state[i]; |
484 | ++ if (!s->timeout) |
485 | ++ continue; |
486 | ++ if (mask_overlap(keep, s->span, sizeof(keep))) |
487 | ++ continue; |
488 | ++ gin_gid_discard(ge, s->id); |
489 | ++ } |
490 | ++ |
491 | ++ grail_mask_foreach(i, gin->used, sizeof(gin->used)) { |
492 | ++ struct slot_state *s = &gin->state[i]; |
493 | + struct gesture_event ev; |
494 | + grail_mask_set(gin->types, s->type); |
495 | +- if (s->priority < hold) |
496 | ++ if (s->priority < hold[s->slice]) |
497 | + continue; |
498 | + while (!gebuf_empty(&s->buf)) { |
499 | + gebuf_get(&s->buf, &ev); |
500 | +@@ -166,7 +195,14 @@ |
501 | + return -1; |
502 | + s = &gin->state[i]; |
503 | + s->type = type; |
504 | +- s->priority = priority; |
505 | ++ if (priority < 0) { |
506 | ++ s->priority = -priority; |
507 | ++ s->slice = 1; |
508 | ++ } else { |
509 | ++ s->priority = priority; |
510 | ++ s->slice = 0; |
511 | ++ } |
512 | ++ s->timeout = 0; |
513 | + s->id = gin->gestureid++ & MAX_GESTURE_ID; |
514 | + s->status = GRAIL_STATUS_BEGIN; |
515 | + s->nclient = 0; |
516 | +@@ -193,6 +229,13 @@ |
517 | + grail_mask_set(gin->unused, i); |
518 | + } |
519 | + |
520 | ++void gin_gid_timeout(struct grail *ge, int gid) |
521 | ++{ |
522 | ++ int i = find_gslot(ge->gin, gid); |
523 | ++ if (i >= 0) |
524 | ++ ge->gin->state[i].timeout = 1; |
525 | ++} |
526 | ++ |
527 | + void gin_gid_event(struct grail *ge, int gid, |
528 | + float x, float y, int ntouch, |
529 | + const grail_prop_t *prop, int nprop, |
530 | + |
531 | +=== modified file 'src/grail-inserter.h' |
532 | +--- a/src/grail-inserter.h 2011-03-17 09:48:13 +0000 |
533 | ++++ b/src/grail-inserter.h 2011-03-28 20:04:11 +0000 |
534 | +@@ -37,6 +37,8 @@ |
535 | + struct slot_state { |
536 | + int type; |
537 | + int priority; |
538 | ++ int slice; |
539 | ++ int timeout; |
540 | + int id; |
541 | + int status; |
542 | + int nclient; |
543 | +@@ -78,6 +80,7 @@ |
544 | + int gin_gid_begin(struct grail *ge, int type, int priority, |
545 | + const struct utouch_frame *frame); |
546 | + void gin_gid_discard(struct grail *ge, int gid); |
547 | ++void gin_gid_timeout(struct grail *ge, int gid); |
548 | + |
549 | + void gin_gid_event(struct grail *ge, int gid, |
550 | + float x, float y, int ntouch, |
551 | + |
552 | +=== modified file 'src/grail-recognizer.c' |
553 | +--- a/src/grail-recognizer.c 2011-01-02 12:08:08 +0000 |
554 | ++++ b/src/grail-recognizer.c 2011-03-28 20:04:07 +0000 |
555 | +@@ -47,9 +47,11 @@ |
556 | + if (!ge->gin || !ge->gru) |
557 | + return; |
558 | + gru_motion(ge, frame); |
559 | ++ gru_touch(ge, frame); |
560 | + gru_drag(ge, frame); |
561 | + gru_pinch(ge, frame); |
562 | + gru_rotate(ge, frame); |
563 | ++ gru_wintouch(ge, frame); |
564 | + gru_windrag(ge, frame); |
565 | + gru_winpinch(ge, frame); |
566 | + gru_winrotate(ge, frame); |
567 | + |
568 | +=== modified file 'src/grail-recognizer.h' |
569 | +--- a/src/grail-recognizer.h 2011-02-24 22:49:22 +0000 |
570 | ++++ b/src/grail-recognizer.h 2011-03-28 20:04:07 +0000 |
571 | +@@ -27,9 +27,11 @@ |
572 | + |
573 | + struct gesture_recognizer { |
574 | + struct move_model move; |
575 | ++ struct combo_model touch; |
576 | + struct combo_model drag; |
577 | + struct combo_model pinch; |
578 | + struct combo_model rotate; |
579 | ++ struct combo_model wintouch; |
580 | + struct combo_model windrag; |
581 | + struct combo_model winpinch; |
582 | + struct combo_model winrotate; |
583 | + |
584 | |
585 | === added file 'debian/patches/0004-dont-hold-back-active-gestures.patch' |
586 | --- debian/patches/0004-dont-hold-back-active-gestures.patch 1970-01-01 00:00:00 +0000 |
587 | +++ debian/patches/0004-dont-hold-back-active-gestures.patch 2011-03-30 15:42:36 +0000 |
588 | @@ -0,0 +1,48 @@ |
589 | +=== modified file 'src/grail-inserter.c' |
590 | +--- a/src/grail-inserter.c 2011-03-28 20:04:13 +0000 |
591 | ++++ b/src/grail-inserter.c 2011-03-30 15:37:59 +0000 |
592 | +@@ -146,7 +146,7 @@ |
593 | + |
594 | + grail_mask_foreach(i, gin->used, sizeof(gin->used)) { |
595 | + struct slot_state *s = &gin->state[i]; |
596 | +- if (!s->nclient || s->priority < discard[s->slice]) |
597 | ++ if (!s->nclient || s->priority < discard[s->slice] && !s->sent) |
598 | + gin_gid_discard(ge, s->id); |
599 | + } |
600 | + |
601 | +@@ -169,12 +169,13 @@ |
602 | + struct slot_state *s = &gin->state[i]; |
603 | + struct gesture_event ev; |
604 | + grail_mask_set(gin->types, s->type); |
605 | +- if (s->priority < hold[s->slice]) |
606 | ++ if (s->priority < hold[s->slice] && !s->sent) |
607 | + continue; |
608 | + while (!gebuf_empty(&s->buf)) { |
609 | + gebuf_get(&s->buf, &ev); |
610 | + gin_send_event(ge, s, &ev, frame); |
611 | + } |
612 | ++ s->sent = 1; |
613 | + } |
614 | + |
615 | + grail_mask_foreach(i, gin->used, sizeof(gin->used)) { |
616 | +@@ -203,6 +204,7 @@ |
617 | + s->slice = 0; |
618 | + } |
619 | + s->timeout = 0; |
620 | ++ s->sent = 0; |
621 | + s->id = gin->gestureid++ & MAX_GESTURE_ID; |
622 | + s->status = GRAIL_STATUS_BEGIN; |
623 | + s->nclient = 0; |
624 | + |
625 | +=== modified file 'src/grail-inserter.h' |
626 | +--- a/src/grail-inserter.h 2011-03-28 20:04:11 +0000 |
627 | ++++ b/src/grail-inserter.h 2011-03-30 15:37:20 +0000 |
628 | +@@ -39,6 +39,7 @@ |
629 | + int priority; |
630 | + int slice; |
631 | + int timeout; |
632 | ++ int sent; |
633 | + int id; |
634 | + int status; |
635 | + int nclient; |
636 | + |
637 | |
638 | === added file 'debian/patches/series' |
639 | --- debian/patches/series 1970-01-01 00:00:00 +0000 |
640 | +++ debian/patches/series 2011-03-30 15:42:36 +0000 |
641 | @@ -0,0 +1,4 @@ |
642 | +0001-set-proper-tap-properties.patch |
643 | +0002-disable-semi-mt-rotation.patch |
644 | +0003-add-touch-gestures.patch |
645 | +0004-dont-hold-back-active-gestures.patch |
We have reached consensus on everything but the much less important semi-mt change. I just cant be bothered with anymore discussions around it. Adding the disputed change to this critical set is bad style. Have fun with it.