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.
This commit is contained in:
Adam Jackson
2005-05-11 00:13:15 +00:00
parent 319e1b28a3
commit df1b2f476d

View File

@@ -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;