[PATCH libinput] evdev: don't return a width/height if we faked the resolution

Hans de Goede hdegoede at redhat.com
Mon Aug 4 01:57:02 PDT 2014


Hi,

On 08/04/2014 03:51 AM, Peter Hutterer wrote:
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

Looks good:

Reviewed-by: Hans de Goede <hdegoede at redhat.com>

Regards,

Hans

> ---
>  src/evdev.c | 7 ++++++-
>  src/evdev.h | 3 ++-
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/src/evdev.c b/src/evdev.c
> index f980812..a125510 100644
> --- a/src/evdev.c
> +++ b/src/evdev.c
> @@ -620,6 +620,7 @@ evdev_configure_device(struct evdev_device *device)
>  				fixed = *absinfo;
>  				fixed.resolution = 1;
>  				libevdev_set_abs_info(evdev, ABS_X, &fixed);
> +				device->abs.fake_resolution = 1;
>  			}
>  			device->abs.absinfo_x = absinfo;
>  			has_abs = 1;
> @@ -629,6 +630,7 @@ evdev_configure_device(struct evdev_device *device)
>  				fixed = *absinfo;
>  				fixed.resolution = 1;
>  				libevdev_set_abs_info(evdev, ABS_Y, &fixed);
> +				device->abs.fake_resolution = 1;
>  			}
>  			device->abs.absinfo_y = absinfo;
>  			has_abs = 1;
> @@ -645,6 +647,7 @@ evdev_configure_device(struct evdev_device *device)
>  				libevdev_set_abs_info(evdev,
>  						      ABS_MT_POSITION_X,
>  						      &fixed);
> +				device->abs.fake_resolution = 1;
>  			}
>  			device->abs.absinfo_x = absinfo;
>  			absinfo = libevdev_get_abs_info(evdev, ABS_MT_POSITION_Y);
> @@ -654,6 +657,7 @@ evdev_configure_device(struct evdev_device *device)
>  				libevdev_set_abs_info(evdev,
>  						      ABS_MT_POSITION_Y,
>  						      &fixed);
> +				device->abs.fake_resolution = 1;
>  			}
>  			device->abs.absinfo_y = absinfo;
>  			device->is_mt = 1;
> @@ -908,7 +912,8 @@ evdev_device_get_size(struct evdev_device *device,
>  	x = libevdev_get_abs_info(device->evdev, ABS_X);
>  	y = libevdev_get_abs_info(device->evdev, ABS_Y);
>  
> -	if (!x || !y || !x->resolution || !y->resolution)
> +	if (!x || !y || device->abs.fake_resolution ||
> +	    !x->resolution || !y->resolution)
>  		return -1;
>  
>  	*width = evdev_convert_to_mm(x, x->maximum);
> diff --git a/src/evdev.h b/src/evdev.h
> index fad1f84..a21b03e 100644
> --- a/src/evdev.h
> +++ b/src/evdev.h
> @@ -67,8 +67,9 @@ struct evdev_device {
>  	int fd;
>  	struct {
>  		const struct input_absinfo *absinfo_x, *absinfo_y;
> +		int fake_resolution;
> +
>  		int32_t x, y;
> -
>  		int32_t seat_slot;
>  
>  		int apply_calibration;
> 


More information about the wayland-devel mailing list