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

Hans de Goede hdegoede at redhat.com
Wed May 18 08:48:45 UTC 2016


Hi,

On 18-05-16 09:02, Peter Hutterer wrote:
> 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>

The commit msg does not match the patch, you're not checking for a non 0 value,
but for == abs->resolution.

Regards,

Hans


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


More information about the wayland-devel mailing list