summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@openbsd.org>2009-11-23 15:25:11 +0000
committerMatthieu Herrb <matthieu@openbsd.org>2009-11-23 15:25:11 +0000
commit352ed8302074a5b7186653deaadd7543d03e4ce5 (patch)
tree4367df6b293917f83be023a26c0bfea7aa1b9af9
parent09286bc24e9ea3ac6660babd8f3e04dafd7db311 (diff)
Handle NetBSD's wsmouse ABI versions. From marc at msys dot ch. Thanks.
-rw-r--r--src/ws.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ws.c b/src/ws.c
index 0a95b24..1db9ab6 100644
--- a/src/ws.c
+++ b/src/ws.c
@@ -664,6 +664,9 @@ static Bool
wsOpen(InputInfoPtr pInfo)
{
WSDevicePtr priv = (WSDevicePtr)pInfo->private;
+#ifdef __NetBSD__
+ int version = WSMOUSE_EVENT_VERSION;
+#endif
DBG(1, ErrorF("WS open %s\n", priv->devName));
pInfo->fd = xf86OpenSerial(pInfo->options);
@@ -671,6 +674,13 @@ wsOpen(InputInfoPtr pInfo)
xf86Msg(X_ERROR, "%s: cannot open input device\n", pInfo->name);
return !Success;
}
+#ifdef __NetBSD__
+ if (ioctl(pInfo->fd, WSMOUSEIO_SETVERSION, &version) == -1) {
+ xf86Msg(X_ERROR, "%s: cannot set wsmouse event version\n",
+ pInfo->name);
+ return !Success;
+ }
+#endif
return Success;
}