[PATCH synaptics] Define various EVIOCGPROP bits if non-existent
Chase Douglas
chase.douglas at canonical.com
Sun Mar 25 09:40:43 PDT 2012
On 03/24/2012 09:09 PM, Peter Hutterer wrote:
> And make the ioctl conditional.
>
> Reported-by: Emmanuel Benisty <benisty.e at gmail.com>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
> src/eventcomm.c | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/src/eventcomm.c b/src/eventcomm.c
> index 3721c91..cd89180 100644
> --- a/src/eventcomm.c
> +++ b/src/eventcomm.c
> @@ -45,6 +45,12 @@
> #include <mtdev.h>
> #endif
>
> +#ifndef INPUT_PROP_BUTTONPAD
> +#define INPUT_PROP_BUTTONPAD 0x02
> +#endif
> +#ifndef INPUT_PROP_SEMI_MT
> +#define INPUT_PROP_SEMI_MT 0x03
> +#endif
>
> #define SYSCALL(call) while (((call) == -1) && (errno == EINTR))
>
> @@ -760,6 +766,7 @@ event_query_touch(InputInfoPtr pInfo)
> priv->max_touches = 0;
> priv->num_mt_axes = 0;
>
> +#ifdef EVIOCGPROP
> SYSCALL(rc = ioctl(pInfo->fd, EVIOCGPROP(sizeof(prop)), &prop));
> if (rc >= 0 && BitIsOn(&prop, INPUT_PROP_SEMI_MT))
> {
> @@ -773,6 +780,7 @@ event_query_touch(InputInfoPtr pInfo)
> xf86IDrvMsg(pInfo, X_INFO, "found clickpad property\n");
> para->clickpad = TRUE;
> }
> +#endif
>
> mtdev = mtdev_new_open(pInfo->fd);
> if (!mtdev)
Yeah, I didn't think about older kernels...
Reviewed-by: Chase Douglas <chase.douglas at canonical.com>
More information about the xorg-devel
mailing list