summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Klausner <wiz@NetBSD.org>2013-08-19 11:14:32 +0200
committerThomas Klausner <wiz@NetBSD.org>2014-03-30 18:36:29 +0200
commitae1a3d6072fea65a8a594f2614f47c43dd8dd267 (patch)
tree285b66a9505af2ba74074fac03d528bcc228540b
parente2cb94b0f3f555f4b1744d63caa587c804f942a2 (diff)
downloadxorg-driver-xf86-input-mouse-ae1a3d6072fea65a8a594f2614f47c43dd8dd267.tar.gz
Make wsmouse (re-)init the version.
This makes sure that the xserver and the mouse speak the same protocol version. Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com> From Matthew R. Green <mrg@NetBSD.org> Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
-rw-r--r--src/mouse.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mouse.c b/src/mouse.c
index 2da2b4d..0c7fc63 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -67,6 +67,12 @@
#include "xserver-properties.h"
#include "xf86-mouse-properties.h"
+#ifdef __NetBSD__
+#include <time.h>
+#include <dev/wscons/wsconsio.h>
+#include <sys/ioctl.h>
+#endif
+
#include "compiler.h"
#include "xisb.h"
@@ -1757,6 +1763,11 @@ MouseProc(DeviceIntPtr device, int what)
if (pInfo->fd == -1)
xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
else {
+#if defined(__NetBSD__) && defined(WSCONS_SUPPORT) && defined(WSMOUSEIO_SETVERSION)
+ int version = WSMOUSE_EVENT_VERSION;
+ if (ioctl(pInfo->fd, WSMOUSEIO_SETVERSION, &version) == -1)
+ xf86Msg(X_WARNING, "%s: cannot set version\n", pInfo->name);
+#endif
if (pMse->xisbscale)
pMse->buffer = XisbNew(pInfo->fd, pMse->xisbscale * 4);
else