~ubuntu-branches/ubuntu/raring/xserver-xorg-input-synaptics/raring-proposed

« back to all changes in this revision

Viewing changes to debian/patches/200_fix_four_tap.patch

  • Committer: Package Import Robot
  • Author(s): Chase Douglas
  • Date: 2012-03-29 15:31:40 UTC
  • mfrom: (0.4.6)
  • Revision ID: package-import@ubuntu.com-20120329153140-1c4pah1guhbmxbua
Tags: 1.5.99.902-0ubuntu1
* New upstream release
* Drop patches merged upstream
  - 200_fix_clickfinger_non-clickpads.patch
  - 201_fix_clickfinger_clickpad_actions.patch
* Revert upstream behavior change: enabling right button area by default
  - Too late to enable in Precise
* Fix erroneous tap actions on four-touch tap (LP: #963327)
  - Add temporary patch 200_fix_four_tap.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 6e0268808fe6d7dfdb5beb198bf067df56452f15 Mon Sep 17 00:00:00 2001
 
2
From: Chase Douglas <chase.douglas@canonical.com>
 
3
Date: Fri, 23 Mar 2012 10:34:44 -0700
 
4
Subject: [PATCH xf86-input-synaptics 1/2] Count number of multitouch touches
 
5
 for multitouch finger count
 
6
 
 
7
The evdev protocol only goes up to three touches for non-multitouch
 
8
devices. If you perform a four touch tap, the finger count will only go
 
9
up to three touches if you roll your fingers, or will always be 0 if all
 
10
four touches land at the same time.
 
11
 
 
12
This change ensures the correct finger count is reported.
 
13
 
 
14
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
 
15
---
 
16
I test build with HAVE_MULTITOUCH undefined to be sure it didn't break
 
17
anything.
 
18
 
 
19
 src/eventcomm.c |   16 ++++++++++++++--
 
20
 1 files changed, 14 insertions(+), 2 deletions(-)
 
21
 
 
22
diff --git a/src/eventcomm.c b/src/eventcomm.c
 
23
index 3721c91..b485377 100644
 
24
--- a/src/eventcomm.c
 
25
+++ b/src/eventcomm.c
 
26
@@ -72,6 +72,7 @@ struct eventcomm_proto_data
 
27
     int axis_map[MT_ABS_SIZE];
 
28
     int cur_slot;
 
29
     ValuatorMask **last_mt_vals;
 
30
+    int num_touches;
 
31
 #endif
 
32
 };
 
33
 
 
34
@@ -565,6 +566,7 @@ EventProcessTouchEvent(InputInfoPtr pInfo, struct SynapticsHwState *hw,
 
35
             if (ev->value >= 0)
 
36
             {
 
37
                 hw->slot_state[slot_index] = SLOTSTATE_OPEN;
 
38
+                proto_data->num_touches++;
 
39
 
 
40
                 if (slot_index >= 0)
 
41
                     valuator_mask_copy(hw->mt_mask[slot_index],
 
42
@@ -574,7 +576,10 @@ EventProcessTouchEvent(InputInfoPtr pInfo, struct SynapticsHwState *hw,
 
43
                                 "Attempted to copy values from out-of-range "
 
44
                                 "slot, touch events may be incorrect.\n");
 
45
             } else
 
46
+            {
 
47
                 hw->slot_state[slot_index] = SLOTSTATE_CLOSE;
 
48
+                proto_data->num_touches--;
 
49
+            }
 
50
         } else
 
51
         {
 
52
             int map = proto_data->axis_map[ev->code - ABS_MT_TOUCH_MAJOR];
 
53
@@ -607,10 +612,17 @@ EventProcessTouchEvent(InputInfoPtr pInfo, struct SynapticsHwState *hw,
 
54
  * @param comm Assembled information from previous events.
 
55
  * @return The number of fingers currently set.
 
56
  */
 
57
-static int count_fingers(const struct CommData *comm)
 
58
+static int count_fingers(InputInfoPtr pInfo, const struct CommData *comm)
 
59
 {
 
60
+    SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
 
61
+    struct eventcomm_proto_data *proto_data = priv->proto_data;
 
62
     int fingers = 0;
 
63
 
 
64
+#ifdef HAVE_MULTITOUCH
 
65
+    if (priv->has_touch)
 
66
+        return proto_data->num_touches;
 
67
+#endif
 
68
+
 
69
     if (comm->oneFinger)
 
70
        fingers = 1;
 
71
     else if (comm->twoFingers)
 
72
@@ -653,7 +665,7 @@ EventReadHwState(InputInfoPtr pInfo,
 
73
        case EV_SYN:
 
74
            switch (ev.code) {
 
75
            case SYN_REPORT:
 
76
-               hw->numFingers = count_fingers(comm);
 
77
+               hw->numFingers = count_fingers(pInfo, comm);
 
78
                hw->millis = 1000 * ev.time.tv_sec + ev.time.tv_usec / 1000;
 
79
                SynapticsCopyHwState(hwRet, hw);
 
80
                return TRUE;
 
81
-- 
 
82
1.7.9.1
 
83
 
 
84
From 4efb7524d12217ccbf1f777dddb7b4bb61b17196 Mon Sep 17 00:00:00 2001
 
85
From: Chase Douglas <chase.douglas@canonical.com>
 
86
Date: Fri, 23 Mar 2012 10:37:46 -0700
 
87
Subject: [PATCH xf86-input-synaptics 2/2] Do not perform a tap action when
 
88
 more than three touches
 
89
 
 
90
Though this looks like a behavior change, it really isn't since the
 
91
maximum tap_max_fingers that was previously possible was already handled.
 
92
The only real change is that if a tap is recognized but the
 
93
tap_max_fingers is zero, a tap will no longer be emitted. This shouldn't
 
94
happen in the real world.
 
95
 
 
96
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
 
97
---
 
98
In Unity we have a four tap gesture to show/hide the dash. Without this
 
99
fix, the dash will often appear and disappear because Unity got the four
 
100
tap gesture and then synaptics sends a button click.
 
101
 
 
102
 src/synaptics.c |    4 +++-
 
103
 1 files changed, 3 insertions(+), 1 deletions(-)
 
104
 
 
105
diff --git a/src/synaptics.c b/src/synaptics.c
 
106
index f07fd13..99b5085 100644
 
107
--- a/src/synaptics.c
 
108
+++ b/src/synaptics.c
 
109
@@ -1798,7 +1798,6 @@ SelectTapButton(SynapticsPrivate *priv, edge_type edge)
 
110
 
 
111
     switch (priv->tap_max_fingers) {
 
112
     case 1:
 
113
-    default:
 
114
        switch (edge) {
 
115
        case RIGHT_TOP_EDGE:
 
116
            DBG(7, "right top edge\n");
 
117
@@ -1830,6 +1829,9 @@ SelectTapButton(SynapticsPrivate *priv, edge_type edge)
 
118
        DBG(7, "three finger tap\n");
 
119
        tap = F3_TAP;
 
120
        break;
 
121
+    default:
 
122
+        priv->tap_button = 0;
 
123
+        return;
 
124
     }
 
125
 
 
126
     priv->tap_button = priv->synpara.tap_action[tap];
 
127
-- 
 
128
1.7.9.1
 
129