mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-04-14 11:44:16 +00:00
Don't enable the device if the grab failed with ENODEV.
After suspend/resume, sometimes the device doesn't come back up on the same node. Since we do not call PreInit for the device (which would detect this situation), we continue to try to read a nonexisting file, spamming the log file with "Read Error".
This commit is contained in:
13
src/evdev.c
13
src/evdev.c
@@ -900,12 +900,15 @@ EvdevProc(DeviceIntPtr device, int what)
|
||||
if (!pEvdev->kernel24 && ioctl(pInfo->fd, EVIOCGRAB, (void *)1))
|
||||
xf86Msg(X_WARNING, "%s: Grab failed (%s)\n", pInfo->name,
|
||||
strerror(errno));
|
||||
xf86AddEnabledDevice(pInfo);
|
||||
if (pEvdev->flags & EVDEV_BUTTON_EVENTS)
|
||||
EvdevMBEmuPreInit(pInfo);
|
||||
device->public.on = TRUE;
|
||||
if (errno != ENODEV)
|
||||
{
|
||||
xf86AddEnabledDevice(pInfo);
|
||||
if (pEvdev->flags & EVDEV_BUTTON_EVENTS)
|
||||
EvdevMBEmuPreInit(pInfo);
|
||||
device->public.on = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case DEVICE_OFF:
|
||||
if (!pEvdev->kernel24 && ioctl(pInfo->fd, EVIOCGRAB, (void *)0))
|
||||
xf86Msg(X_WARNING, "%s: Release failed (%s)\n", pInfo->name,
|
||||
|
||||
Reference in New Issue
Block a user