Merge lp:~fboucault/unity-2d/fix_geis_gesture_names into lp:unity-2d/3.0

Proposed by Florian Boucault
Status: Merged
Approved by: Florian Boucault
Approved revision: 447
Merged at revision: 469
Proposed branch: lp:~fboucault/unity-2d/fix_geis_gesture_names
Merge into: lp:unity-2d/3.0
Diff against target: 58 lines (+6/-9)
1 file modified
launcher/app/gesturehandler.cpp (+6/-9)
To merge this branch: bzr merge lp:~fboucault/unity-2d/fix_geis_gesture_names
Reviewer Review Type Date Requested Status
Olivier Tilloy Approve
Review via email: mp+53131@code.launchpad.net

Description of the change

[touch] Fixed multitouch gestures handling that broke due to an API change in utouch-geis.

Since an unknown new version of utouch-geis, that has landed in Ubuntu Natty, geis gestures's GEIS_GESTURE_ATTRIBUTE_GESTURE_NAME has changed slightly to include the number of fingers. Example:

Before: "Tap"
After: "Tap,touch=4"

To post a comment you must log in.
Revision history for this message
Olivier Tilloy (osomon) wrote :

My testing abilities are limited because I’m not running Natty natively on my macbook yet, therefore the trackpad doesn’t work in a virtual machine. So I’ll take your word for it that it fixes touch support on Natty.

However I did as many sanity checks as possible on your changes, and they look sane and complete. The code compiles both on Maverick and Natty, but it (silently) breaks touch support on Maverick: this change should *not* be backported to Maverick, unless the corresponding version of libutouch-geis is backported too.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/app/gesturehandler.cpp'
2--- launcher/app/gesturehandler.cpp 2011-03-04 10:23:26 +0000
3+++ launcher/app/gesturehandler.cpp 2011-03-12 15:20:00 +0000
4@@ -193,9 +193,8 @@
5 QHash<QString, GeisGestureAttr> attributes)
6 {
7 QString gestureName = attributes[GEIS_GESTURE_ATTRIBUTE_GESTURE_NAME].string_val;
8- int touches = attributes[GEIS_GESTURE_ATTRIBUTE_TOUCHES].integer_val;
9
10- if (gestureName == GEIS_GESTURE_PINCH && touches == 3) {
11+ if (gestureName == GEIS_GESTURE_TYPE_PINCH3) {
12 /* 3 fingers pinch inwards shows the workspace switcher (zoom out showing all workspaces)
13 3 fingers pinch outwards (also called 'spread' by designers) hides the workspace switcher (zoom in a workspace)
14 */
15@@ -208,7 +207,7 @@
16
17 m_pinchPreviousRadius = attributes[GEIS_GESTURE_ATTRIBUTE_RADIUS].float_val;
18 m_pinchPreviousTimestamp = attributes[GEIS_GESTURE_ATTRIBUTE_TIMESTAMP].integer_val;
19- } else if (gestureName == GEIS_GESTURE_DRAG && touches == 4) {
20+ } else if (gestureName == GEIS_GESTURE_TYPE_DRAG4) {
21 /* 4 fingers drag reveals the launcher progressively; if the drag goes far
22 enough, the launcher is then locked in place and does not autohide anymore */
23 /* FIXME: only supports the launcher positioned on the left edge of the screen */
24@@ -222,12 +221,11 @@
25 QHash<QString, GeisGestureAttr> attributes)
26 {
27 QString gestureName = attributes[GEIS_GESTURE_ATTRIBUTE_GESTURE_NAME].string_val;
28- int touches = attributes[GEIS_GESTURE_ATTRIBUTE_TOUCHES].integer_val;
29
30- if (gestureName == GEIS_GESTURE_TAP && touches == 4) {
31+ if (gestureName == GEIS_GESTURE_TYPE_TAP4) {
32 /* 4 fingers tap toggles the dash on and off */
33 toggleDash();
34- } else if (gestureName == GEIS_GESTURE_PINCH && touches == 3) {
35+ } else if (gestureName == GEIS_GESTURE_TYPE_PINCH3) {
36 /* Continuing a 3 fingers pinch inwards/outwards shows/hides the workspace switcher. */
37 int timestamp = attributes[GEIS_GESTURE_ATTRIBUTE_TIMESTAMP].integer_val;
38 float radius = attributes[GEIS_GESTURE_ATTRIBUTE_RADIUS].float_val;
39@@ -256,7 +254,7 @@
40 m_pinchPreviousRadius = radius;
41 m_pinchPreviousTimestamp = timestamp;
42 }
43- } else if (gestureName == GEIS_GESTURE_DRAG && touches == 4) {
44+ } else if (gestureName == GEIS_GESTURE_TYPE_DRAG4) {
45 /* FIXME: only supports the launcher positioned on the left edge of the screen */
46 m_dragDelta += attributes[GEIS_GESTURE_ATTRIBUTE_DELTA_X].float_val;
47 m_launcher->setDelta(m_dragDelta);
48@@ -276,9 +274,8 @@
49 QHash<QString, GeisGestureAttr> attributes)
50 {
51 QString gestureName = attributes[GEIS_GESTURE_ATTRIBUTE_GESTURE_NAME].string_val;
52- int touches = attributes[GEIS_GESTURE_ATTRIBUTE_TOUCHES].integer_val;
53
54- if (gestureName == GEIS_GESTURE_DRAG && touches == 4) {
55+ if (gestureName == GEIS_GESTURE_TYPE_DRAG4) {
56 m_dragDelta += attributes[GEIS_GESTURE_ATTRIBUTE_DELTA_X].float_val;
57 m_launcher->setDelta(m_dragDelta);
58 m_launcher->setManualSliding(false);

Subscribers

People subscribed via source and target branches