[PATCH] Check other clients' core masks properly when adding touch listener

Peter Hutterer peter.hutterer at who-t.net
Wed Apr 18 16:00:07 PDT 2012


On Wed, Apr 18, 2012 at 12:17:15PM -0700, Chase Douglas wrote:
> The current code checks the core event mask as though it were an XI
> mask. This change fixes the checks so the proper client and event masks
> are used.
> 
> Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
> ---
>  dix/touch.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/dix/touch.c b/dix/touch.c
> index 572bdfb..ecb2283 100644
> --- a/dix/touch.c
> +++ b/dix/touch.c
> @@ -811,6 +811,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
>      if (mask & EVENT_CORE_MASK) {
>          int coretype = GetCoreType(TouchGetPointerEventType(ev));
>          Mask core_filter = event_get_filter_from_type(dev, coretype);
> +        OtherClients *oclients;
>  
>          /* window owner */
>          if (IsMaster(dev) && (win->eventMask & core_filter)) {
> @@ -822,13 +823,13 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
>          }
>  
>          /* all others */
> -        nt_list_for_each_entry(iclients, (InputClients *) wOtherClients(win),
> +        nt_list_for_each_entry(oclients, (OtherClients *) wOtherClients(win),

you can skip the cast here, but otherwise Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

Cheers,
  Peter

>                                 next) {
> -            if (!(iclients->mask[XIAllDevices] & core_filter))
> +            if (!(oclients->mask & core_filter))
>                  continue;
>  
>              TouchEventHistoryAllocate(ti);
> -            TouchAddListener(ti, iclients->resource, CORE,
> +            TouchAddListener(ti, oclients->resource, CORE,
>                               type, LISTENER_AWAITING_BEGIN, win);
>              return TRUE;
>          }
> -- 
> 1.7.9.1
> 


More information about the xorg-devel mailing list