[PATCH libinput] evdev: Ensure the libevdev object receives the new fd on resume

Peter Hutterer peter.hutterer at who-t.net
Tue Dec 9 16:40:59 PST 2014


On Tue, Dec 09, 2014 at 03:55:32PM +0100, Carlos Garnacho wrote:
> Otherwise, input_events will be attempted to read from the wrong place,
> which also leaves the right/current fd with pending data to be read,
> making the epoll fd wake up constantly.
> 
> Signed-off-by: Carlos Garnacho <carlosg at gnome.org>

huh, this seems like something the test should've caught. I'll look into
that, meanwhile - merged locally, thanks

Cheers,
   Peter

> ---
>  src/evdev.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/evdev.c b/src/evdev.c
> index c8ca384..137c20c 100644
> --- a/src/evdev.c
> +++ b/src/evdev.c
> @@ -2012,6 +2012,9 @@ evdev_device_resume(struct evdev_device *device)
>  			return -ENODEV;
>  	}
>  
> +	libevdev_change_fd(device->evdev, fd);
> +	libevdev_set_clock_id(device->evdev, CLOCK_MONOTONIC);
> +
>  	device->source =
>  		libinput_add_fd(libinput, fd, evdev_device_dispatch, device);
>  	if (!device->source) {
> -- 
> 2.1.0
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
> 


More information about the wayland-devel mailing list