diff options
author | Chase Douglas <chase.douglas@canonical.com> | 2012-02-01 15:42:21 -0800 |
---|---|---|
committer | Chase Douglas <chase.douglas@canonical.com> | 2012-02-06 08:35:16 -0800 |
commit | a8b065eeb847493afd31e49623fac9c952811993 (patch) | |
tree | 7c3c631c68fa830eea7e3274054b1cdaaadec198 /src/eventcomm.c | |
parent | 4824f67e7b9cf402a2df10c17f583916c4ef83eb (diff) |
Don't initialize touch state if device does is not multitouch
And don't attempt to use it either.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'src/eventcomm.c')
-rw-r--r-- | 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); |