[PATCH xf86-input-synaptics v3 2/3] Don't initialize touch state if device does is not multitouch
Chase Douglas
chase.douglas at canonical.com
Mon Feb 6 08:40:46 PST 2012
And don't attempt to use it either.
Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
---
Changes since v2:
* Rebased onto master
src/eventcomm.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/eventcomm.c b/src/eventcomm.c
index 6a55df0..41504f9 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -108,7 +108,7 @@ UninitializeTouch(InputInfoPtr pInfo)
SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
struct eventcomm_proto_data *proto_data = (struct eventcomm_proto_data*)priv->proto_data;
- if (!proto_data->mtdev)
+ if (!priv->has_touch)
return;
free(proto_data->open_slots);
@@ -136,6 +136,9 @@ InitializeTouch(InputInfoPtr pInfo)
struct eventcomm_proto_data *proto_data = (struct eventcomm_proto_data*)priv->proto_data;
int i;
+ if (!priv->has_touch)
+ return;
+
proto_data->mtdev = mtdev_new_open(pInfo->fd);
if (!proto_data->mtdev)
{
@@ -630,6 +633,9 @@ EventProcessTouchEvent(InputInfoPtr pInfo, struct CommData *comm,
SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
struct eventcomm_proto_data *proto_data = priv->proto_data;
+ if (!priv->has_touch)
+ return;
+
if (ev->code == ABS_MT_SLOT)
{
EventProcessTouch(pInfo);
--
1.7.8.3
More information about the xorg-devel
mailing list