From 028e7d0001d4948e7b11a68d904c6b307a1ccfb3 Mon Sep 17 00:00:00 2001 From: Matthias Hopf Date: Mon, 29 Sep 2008 18:30:55 +0200 Subject: Grab mouse from kernel if possible. Avoids mouse event duplication if a mouse driver is sitting on /dev/input/mice on Linux. --- src/vmmouse.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/vmmouse.c b/src/vmmouse.c index bc0cb87..98f7047 100644 --- a/src/vmmouse.c +++ b/src/vmmouse.c @@ -851,6 +851,11 @@ VMMouseDeviceControl(DeviceIntPtr device, int mode) xf86Msg(X_INFO, "VMWARE(0): vmmouse enabled\n"); } } +#ifdef EVIOCGRAB + if (ioctl(pInfo->fd, EVIOCGRAB, (void *)1)) + xf86Msg(X_WARNING, "%s: Grab failed (%s)\n", pInfo->name, + strerror(errno)); +#endif xf86FlushInput(pInfo->fd); xf86AddEnabledDevice(pInfo); } @@ -870,6 +875,11 @@ VMMouseDeviceControl(DeviceIntPtr device, int mode) mPriv->vmmouseAvailable = FALSE; } +#ifdef EVIOCGRAB + if (ioctl(pInfo->fd, EVIOCGRAB, (void *)0)) + xf86Msg(X_WARNING, "%s: Ungrab failed (%s)\n", pInfo->name, + strerror(errno)); +#endif xf86RemoveEnabledDevice(pInfo); if (pMse->buffer) { XisbFree(pMse->buffer); -- cgit v1.2.3