[PATCH libinput 1/3] test: skip manually setting uinput resolution if it's already set

Peter Hutterer peter.hutterer at who-t.net
Wed May 18 07:02:17 UTC 2016


If we have libevdev 1.5 or later, the resolution is already set, no need to
change it again. Let's rely on libevdev to do the right thing and simply skip
the rest if we have one nonzero resolution already set on the device.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 test/litest.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/test/litest.c b/test/litest.c
index 7f5a4d7..66f08f2 100644
--- a/test/litest.c
+++ b/test/litest.c
@@ -2293,6 +2293,10 @@ litest_create_uinput(const char *name,
 	abs = abs_info;
 	while (abs && abs->value != -1) {
 		if (abs->resolution != 0) {
+			if (libevdev_get_abs_resolution(dev, abs->value) ==
+			    abs->resolution)
+				break;
+
 			rc = libevdev_kernel_set_abs_info(dev,
 							  abs->value,
 							  abs);
-- 
2.7.4



More information about the wayland-devel mailing list