[PATCH] evdev: Provide the valuators on Button(Press|Release) events.

Peter Hutterer peter.hutterer at who-t.net
Mon Aug 3 23:22:07 PDT 2009


On Sun, Aug 02, 2009 at 04:24:02PM +0300, oliver.mcfadden at nokia.com wrote:
> From: Oliver McFadden <oliver.mcfadden at nokia.com>
> 
> This feature is especially useful for touchscreen devices and is only
> enabled with an X server which provides the xf86PostButtonEventP helper
> function. See X server commit 8da0ff2d51086666d10ca7330d428e8610a4a0e3.

Have you tested this patch sufficiently?
Please test it in a full environment, last I checked there were some issues
with not sending motion events between button events and I'm not sure they
are gone.

The server certainly doesn't emulate emotion events in between so you need
to make sure that any motion gets appended to the motion history (I think
this is the case, check GetPointerEvents) and that clients work properly
with it.


> ---
>  configure.ac |    8 ++++++++
>  src/evdev.c  |    8 +++++---
>  2 files changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 46a1c19..ebeb239 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -67,6 +67,14 @@ AC_SUBST([sdkdir])
>  # Checks for header files.
>  AC_HEADER_STDC
>  
> +# Checks for library functions.
> +SAVED_CFLAGS="$CFLAGS"
> +CFLAGS="$CWARNFLAGS $XORG_CFLAGS"
> +AC_CHECK_DECL([xf86PostButtonEventP], AC_DEFINE(HAVE_XF86POSTBUTTONEVENTP, 1, [Have xf86PostButtonEventP]), [],
> +	      [#include <xorg-server.h>
> +	       #include <xf86Xinput.h>])
> +CFLAGS="$SAVED_CFLAGS"
> +
>  DRIVER_NAME=evdev
>  AC_SUBST([DRIVER_NAME])
>  
> diff --git a/src/evdev.c b/src/evdev.c
> index 9528dbf..7ea2ef7 100644
> --- a/src/evdev.c
> +++ b/src/evdev.c
> @@ -679,11 +679,13 @@ static void EvdevPostQueuedEvents(InputInfoPtr pInfo, int *num_v, int *first_v,
>                                    pEvdev->queue[i].val);
>              break;
>          case EV_QUEUE_BTN:
> -            /* FIXME: Add xf86PostButtonEventP to the X server so that we may
> -             * pass the valuators on ButtonPress/Release events, too.  Currently
> -             * only MotionNotify events contain the pointer position. */
> +#ifdef HAVE_XF86POSTBUTTONEVENTP

it's easier to check for ABI_XINPUT_VERSION 7, or - if needed - we can bump
it again to easy bisecting.

> +            xf86PostButtonEventP(pInfo->dev, !pEvdev->rel, pEvdev->queue[i].key,
> +                                 pEvdev->queue[i].val, *first_v, *num_v, v);
> +#else
>              xf86PostButtonEvent(pInfo->dev, 0, pEvdev->queue[i].key,
>                                  pEvdev->queue[i].val, 0, 0);
> +#endif
>              break;
>          }
>      }
> -- 
> 1.6.1
 
Cheers,
  Peter


More information about the xorg-devel mailing list