diff options
author | Matthias Hopf <mhopf@suse.de> | 2008-09-29 18:30:55 +0200 |
---|---|---|
committer | Matthias Hopf <mhopf@suse.de> | 2008-09-29 18:30:55 +0200 |
commit | 028e7d0001d4948e7b11a68d904c6b307a1ccfb3 (patch) | |
tree | 0f894b24c2a0095696948ecd8bfb87196aa25fb3 /src | |
parent | a5fb5b8cb816ddcdc25a61fa42b560955a4194e3 (diff) |
Grab mouse from kernel if possible.
Avoids mouse event duplication if a mouse driver is sitting on /dev/input/mice
on Linux.
Diffstat (limited to 'src')
-rw-r--r-- | src/vmmouse.c | 10 |
1 files changed, 10 insertions, 0 deletions
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); |