Merge lp:~bregma/geis/lp-737745 into lp:geis

Proposed by Stephen M. Webb
Status: Merged
Merged at revision: 120
Proposed branch: lp:~bregma/geis/lp-737745
Merge into: lp:geis
Diff against target: 98 lines (+20/-26)
4 files modified
ChangeLog (+12/-0)
libutouch-geis/backend/xcb/geis_xcb_backend.c (+8/-7)
libutouch-geis/backend/xcb/grail_gestures.c (+0/-17)
libutouch-geis/backend/xcb/grail_gestures.h (+0/-2)
To merge this branch: bzr merge lp:~bregma/geis/lp-737745
Reviewer Review Type Date Requested Status
Henrik Rydberg (community) Approve
Chase Douglas (community) Approve
Review via email: mp+54373@code.launchpad.net

Description of the change

Corrects the gesture touch count to reflect the number of touches returned from grail.

To post a comment you must log in.
Revision history for this message
Chase Douglas (chasedouglas) wrote :

Looks good to me. Probably should have a test unit, but we're crunched on time.

review: Approve
Revision history for this message
Henrik Rydberg (rydberg) wrote :

Same here.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2011-03-17 23:42:48 +0000
3+++ ChangeLog 2011-03-22 16:16:31 +0000
4@@ -1,3 +1,15 @@
5+2011-03-22 Stephen M. Webb <stephen.webb@canonical.com>
6+
7+ Corrected the number of touches on a gesture event (LP: #737745)
8+
9+ * libutouch-geis/backend/xcb/geis_xcb_backend.c (_dispatch_gesture):
10+ replaced geis_xcb_backend_touch_count() call with a calculation based on
11+ the number of touch properties passed from grail
12+ * libutouch-geis/backend/xcb/grail_gestures.c (geis_xcb_backend_touch_count):
13+ removed
14+ * libutouch-geis/backend/xcb/grail_gestures.h (geis_xcb_backend_touch_count):
15+ removed
16+
17 2011-03-17 Stephen M. Webb <stephen.webb@canonical.com>
18
19 Added definitions for GEIS v1 gesture primitive types (LP: #737230).
20
21=== modified file 'libutouch-geis/backend/xcb/geis_xcb_backend.c'
22--- libutouch-geis/backend/xcb/geis_xcb_backend.c 2011-03-16 22:12:42 +0000
23+++ libutouch-geis/backend/xcb/geis_xcb_backend.c 2011-03-22 16:16:31 +0000
24@@ -206,6 +206,7 @@
25 float *properties = (float *)(grail_event + 1);
26 GeisSize num_properties = grail_event->num_props;
27 GeisSize num_unmapped_properties = num_properties;
28+ GeisSize touch_count;
29
30 geis_attr_set_destructor(group_attr, (GeisAttrDestructor)geis_groupset_delete);
31 geis_attr_set_destructor(touch_attr, (GeisAttrDestructor)geis_touchset_delete);
32@@ -271,18 +272,18 @@
33 &grail_event->focus_y);
34 geis_frame_add_attr(frame, attr);
35
36- GeisSize touch_count = geis_xcb_backend_touch_count(grail_event->gesture_type);
37+ num_unmapped_properties = geis_xcb_backend_map_grail_attrs(
38+ grail_event->gesture_type,
39+ num_properties, properties, frame);
40+
41+ /* any remaining properties are touch properties */
42+ touch_count = (num_properties - num_unmapped_properties) / 3;
43+ properties += touch_count * 3;
44 attr = geis_attr_new(GEIS_GESTURE_ATTRIBUTE_TOUCHES,
45 GEIS_ATTR_TYPE_INTEGER,
46 &touch_count);
47 geis_frame_add_attr(frame, attr);
48
49- num_unmapped_properties = geis_xcb_backend_map_grail_attrs(
50- grail_event->gesture_type,
51- num_properties, properties, frame);
52-
53- /* any remaining properties are touch properties */
54- properties += (num_properties - num_unmapped_properties);
55 GeisSize i;
56 for (i = 0; i < touch_count; ++i)
57 {
58
59=== modified file 'libutouch-geis/backend/xcb/grail_gestures.c'
60--- libutouch-geis/backend/xcb/grail_gestures.c 2011-03-17 23:42:48 +0000
61+++ libutouch-geis/backend/xcb/grail_gestures.c 2011-03-22 16:16:31 +0000
62@@ -342,23 +342,6 @@
63
64
65 GeisSize
66-geis_xcb_backend_touch_count(GeisInteger grail_type)
67-{
68- const GrailClassMap *grail_class;
69- for (grail_class = s_grail_class_map;
70- grail_class->geis_class_id >= 0;
71- ++grail_class)
72- {
73- if (grail_class->grail_type == grail_type)
74- {
75- return grail_class->touch_count;
76- }
77- }
78- return 0;
79-}
80-
81-
82-GeisSize
83 geis_xcb_backend_map_grail_attrs(GeisInteger grail_type,
84 GeisSize num_properties,
85 float *properties,
86
87=== modified file 'libutouch-geis/backend/xcb/grail_gestures.h'
88--- libutouch-geis/backend/xcb/grail_gestures.h 2011-02-17 18:16:05 +0000
89+++ libutouch-geis/backend/xcb/grail_gestures.h 2011-03-22 16:16:31 +0000
90@@ -31,8 +31,6 @@
91
92 GeisInteger geis_xcb_backend_primitive_class(GeisInteger grail_gesture_type);
93
94-GeisSize geis_xcb_backend_touch_count(GeisInteger grail_gesture_type);
95-
96 GeisSize geis_xcb_backend_map_grail_attrs(GeisInteger grail_type,
97 GeisSize num_properties,
98 float *properties,

Subscribers

People subscribed via source and target branches