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

Carlos Garnacho carlosg at gnome.org
Tue Dec 9 06:55:32 PST 2014


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



More information about the wayland-devel mailing list