[PATCH libinput 08/17] evdev: factor out closing a device into evdev_suspend()

Peter Hutterer peter.hutterer at who-t.net
Tue Sep 2 19:02:59 PDT 2014


No functional changes, just prep work for an upcoming patch

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev.c | 13 +++++++++++--
 src/evdev.h |  2 ++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index 71c5236..054beb6 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1165,8 +1165,8 @@ release_pressed_keys(struct evdev_device *device)
 	}
 }
 
-void
-evdev_device_remove(struct evdev_device *device)
+int
+evdev_device_suspend(struct evdev_device *device)
 {
 	if (device->source)
 		libinput_remove_source(device->base.seat->libinput,
@@ -1178,6 +1178,15 @@ evdev_device_remove(struct evdev_device *device)
 		mtdev_close_delete(device->mtdev);
 	close_restricted(device->base.seat->libinput, device->fd);
 	device->fd = -1;
+
+	return 0;
+}
+
+void
+evdev_device_remove(struct evdev_device *device)
+{
+	evdev_device_suspend(device);
+
 	list_remove(&device->base.link);
 
 	notify_removed_device(&device->base);
diff --git a/src/evdev.h b/src/evdev.h
index 9de44bc..ef02491 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -186,6 +186,8 @@ double
 evdev_device_transform_y(struct evdev_device *device,
 			 double y,
 			 uint32_t height);
+int
+evdev_device_suspend(struct evdev_device *device);
 
 void
 evdev_keyboard_notify_key(struct evdev_device *device,
-- 
1.9.3



More information about the wayland-devel mailing list