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
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.
12
This change ensures the correct finger count is reported.
14
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
16
I test build with HAVE_MULTITOUCH undefined to be sure it didn't break
19
src/eventcomm.c | 16 ++++++++++++++--
20
1 files changed, 14 insertions(+), 2 deletions(-)
22
diff --git a/src/eventcomm.c b/src/eventcomm.c
23
index 3721c91..b485377 100644
26
@@ -72,6 +72,7 @@ struct eventcomm_proto_data
27
int axis_map[MT_ABS_SIZE];
29
ValuatorMask **last_mt_vals;
34
@@ -565,6 +566,7 @@ EventProcessTouchEvent(InputInfoPtr pInfo, struct SynapticsHwState *hw,
37
hw->slot_state[slot_index] = SLOTSTATE_OPEN;
38
+ proto_data->num_touches++;
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");
47
hw->slot_state[slot_index] = SLOTSTATE_CLOSE;
48
+ proto_data->num_touches--;
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.
57
-static int count_fingers(const struct CommData *comm)
58
+static int count_fingers(InputInfoPtr pInfo, const struct CommData *comm)
60
+ SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
61
+ struct eventcomm_proto_data *proto_data = priv->proto_data;
64
+#ifdef HAVE_MULTITOUCH
65
+ if (priv->has_touch)
66
+ return proto_data->num_touches;
71
else if (comm->twoFingers)
72
@@ -653,7 +665,7 @@ EventReadHwState(InputInfoPtr pInfo,
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);
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
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.
96
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
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.
102
src/synaptics.c | 4 +++-
103
1 files changed, 3 insertions(+), 1 deletions(-)
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)
111
switch (priv->tap_max_fingers) {
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");
122
+ priv->tap_button = 0;
126
priv->tap_button = priv->synpara.tap_action[tap];