summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--driver/xf86-input-synaptics/src/wsconscomm.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/driver/xf86-input-synaptics/src/wsconscomm.c b/driver/xf86-input-synaptics/src/wsconscomm.c
index a439dacc8..e76b2dd1d 100644
--- a/driver/xf86-input-synaptics/src/wsconscomm.c
+++ b/driver/xf86-input-synaptics/src/wsconscomm.c
@@ -35,6 +35,7 @@ extern int priv_open_device(const char *);
#endif
#define DEFAULT_WSMOUSE0_DEV "/dev/wsmouse0"
+#define NEVENTS 64
static const char *synaptics_devs[] = {
DEFAULT_WSMOUSE0_DEV,
@@ -90,6 +91,8 @@ WSConsDeviceOffHook(InputInfoPtr pInfo)
static Bool
WSConsQueryHardware(InputInfoPtr pInfo)
{
+ SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
+ struct CommData *comm = &priv->comm;
int wsmouse_type;
if (ioctl(pInfo->fd, WSMOUSEIO_GTYPE, &wsmouse_type) == -1) {
@@ -97,10 +100,16 @@ WSConsQueryHardware(InputInfoPtr pInfo)
return FALSE;
}
- if (wsmouse_type == WSMOUSE_TYPE_SYNAPTICS)
- return TRUE;
+ if (wsmouse_type != WSMOUSE_TYPE_SYNAPTICS)
+ return FALSE;
- return FALSE;
+ if (comm->buffer)
+ XisbFree(comm->buffer);
+ comm->buffer = XisbNew(pInfo->fd, sizeof(struct wscons_event) * NEVENTS);
+ if (comm->buffer == NULL)
+ return FALSE;
+
+ return TRUE;
}
static Bool