From df1b2f476dde1f6cbc13e9731d772a42baf97adb Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 11 May 2005 00:13:15 +0000 Subject: Bug #968: Grab the event device used by the evdev driver to avoid weird issues when input goes to multiple places. Restrict building the evdev driver to 2.6 kernels since EVIOCGRAB didn't exist in 2.4. --- src/evdev.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/evdev.c b/src/evdev.c index 462cfc8..12b0c77 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -61,10 +61,6 @@ #define MODEFLAG 8 #define COMPOSEFLAG 16 -#ifndef EV_RST -#define EV_RST EV_SYN -#endif - static int wheel_up_button = 4; static int wheel_down_button = 5; static int wheel_left_button = 6; @@ -156,7 +152,7 @@ EvdevReadInput(InputInfoPtr pInfo) } break; - case EV_RST: + case EV_SYN: break; } } @@ -490,11 +486,17 @@ EvdevProc(DeviceIntPtr device, int what) return EvdevInit(device); case DEVICE_ON: + if (ioctl(pInfo->fd, EVIOCGRAB, (void *)1)) + xf86Msg(X_WARNING, "%s: Grab failed (%s)\n", pInfo->name, + strerror(errno)); xf86AddEnabledDevice(pInfo); device->public.on = TRUE; break; case DEVICE_OFF: + if (ioctl(pInfo->fd, EVIOCGRAB, (void *)0)) + xf86Msg(X_WARNING, "%s: Release failed (%s)\n", pInfo->name, + strerror(errno)); xf86RemoveEnabledDevice(pInfo); device->public.on = FALSE; break; -- cgit v1.2.3