summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@canonical.com>2012-04-02 11:23:05 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2012-04-13 13:40:54 +1000
commit38b93b71c812c6d7b7085f40d049b0a4927e52dd (patch)
treeac8011fc3875a20a74d09e2b1601d6218ad814cd
parent5a1612d4496b51682c9043aa064025c545249de6 (diff)
Use maximum number of touches reported by evdev
This resolves a regression from da461b91659d0c64aa6827e065aee2682116a57e where three touch tap and click actions on certain devices no longer work. Some devices report a higher touch count than the number of touches they can provide data for. For example, many Synaptics touchpads can report up to five touches, but only provide data for two of them. We need to be able to report the correct number of touches for these devices when there are three touches. Using the maximum of the reported touch count and the number of touches provided ensures the count is accurate for all device types. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/eventcomm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/eventcomm.c b/src/eventcomm.c
index 361f878..9d1233c 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -627,11 +627,6 @@ static int count_fingers(InputInfoPtr pInfo, const struct CommData *comm)
struct eventcomm_proto_data *proto_data = priv->proto_data;
int fingers = 0;
-#ifdef HAVE_MULTITOUCH
- if (priv->has_touch)
- return proto_data->num_touches;
-#endif
-
if (comm->oneFinger)
fingers = 1;
else if (comm->twoFingers)
@@ -639,6 +634,11 @@ static int count_fingers(InputInfoPtr pInfo, const struct CommData *comm)
else if (comm->threeFingers)
fingers = 3;
+#ifdef HAVE_MULTITOUCH
+ if (priv->has_touch && proto_data->num_touches > fingers)
+ fingers = proto_data->num_touches;
+#endif
+
return fingers;
}