[RFC XI 2.1 - xserver 9/9] test: input - set all touch events at once

Peter Hutterer peter.hutterer at who-t.net
Thu Nov 18 22:40:04 PST 2010


On Fri, Nov 12, 2010 at 05:35:10PM -0500, Chase Douglas wrote:
> From: Chase Douglas <chase.douglas at ubuntu.com>
> 
> Clients can't select for the three touch events individually, so ensure
> the test doesn't try to do so.
> 
> Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
>
> ---
>  test/xi2/protocol-xiselectevents.c |   48 ++++++++++++++++++++++++++++++++++++
>  1 files changed, 48 insertions(+), 0 deletions(-)
> 
> diff --git a/test/xi2/protocol-xiselectevents.c b/test/xi2/protocol-xiselectevents.c
> index fe1c26d..631a581 100644
> --- a/test/xi2/protocol-xiselectevents.c
> +++ b/test/xi2/protocol-xiselectevents.c
> @@ -159,7 +159,18 @@ static void request_XISelectEvents_masks(xXISelectEventsReq *req)
>          memset(bits, 0, mask->mask_len * 4);
>          for (j = 0; j <= XI_LASTEVENT; j++)
>          {
> +            /* Can't select for these events alone */
> +            if (j == XI_TouchMotion || j == XI_TouchEnd)
> +                continue;
> +
>              SetBit(bits, j);
> +
> +            /* Must select for all touch events at once */
> +            if (j == XI_TouchBegin) {
> +                SetBit(bits, XI_TouchMotion);
> +                SetBit(bits, XI_TouchEnd);
> +            }
> +
>              request_XISelectEvent(req, Success);
>              ClearBit(bits, j);
>          }
> @@ -175,7 +186,18 @@ static void request_XISelectEvents_masks(xXISelectEventsReq *req)
>  
>          for (j = 0; j <= XI_LASTEVENT; j++)
>          {
> +            /* Can't select for these events alone */
> +            if (j == XI_TouchMotion || j == XI_TouchEnd)
> +                continue;
> +
>              SetBit(bits, j);
> +
> +            /* Must select for all touch events at once */
> +            if (j == XI_TouchBegin) {
> +                SetBit(bits, XI_TouchMotion);
> +                SetBit(bits, XI_TouchEnd);
> +            }
> +
>              request_XISelectEvent(req, Success);
>          }
>  
> @@ -189,7 +211,18 @@ static void request_XISelectEvents_masks(xXISelectEventsReq *req)
>  
>          for (j = XI_LASTEVENT + 1; j < mask->mask_len * 4; j++)
>          {
> +            /* Can't select for these events alone */
> +            if (j == XI_TouchMotion || j == XI_TouchEnd)
> +                continue;
> +
>              SetBit(bits, j);
> +
> +            /* Must select for all touch events at once */
> +            if (j == XI_TouchBegin) {
> +                SetBit(bits, XI_TouchMotion);
> +                SetBit(bits, XI_TouchEnd);
> +            }
> +
>              request_XISelectEvent(req, BadValue);
>              ClearBit(bits, j);
>          }
> @@ -202,7 +235,18 @@ static void request_XISelectEvents_masks(xXISelectEventsReq *req)
>          memset(bits, 0, mask->mask_len * 4);
>          for (j = 0; j <= XI_LASTEVENT; j++)
>          {
> +            /* Can't select for these events alone */
> +            if (j == XI_TouchMotion || j == XI_TouchEnd)
> +                continue;
> +
>              SetBit(bits, j);
> +
> +            /* Must select for all touch events at once */
> +            if (j == XI_TouchBegin) {
> +                SetBit(bits, XI_TouchMotion);
> +                SetBit(bits, XI_TouchEnd);
> +            }
> +
>              request_XISelectEvent(req, Success);
>          }
>  
> @@ -231,6 +275,10 @@ static void request_XISelectEvents_masks(xXISelectEventsReq *req)
>          for (j = 0; j <= XI_LASTEVENT; j++)
>              SetBit(bits, j);
>          ClearBit(bits, XI_HierarchyChanged);
> +        /* Can't select for touch events on all master devices */
> +        ClearBit(bits, XI_TouchBegin);
> +        ClearBit(bits, XI_TouchMotion);
> +        ClearBit(bits, XI_TouchEnd);
>          for (j = 1; j < 6; j++)
>          {
>              mask->deviceid = j;
> -- 
> 1.7.1
 
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

given the current semantics

Cheers,
  Peter


More information about the xorg-devel mailing list