[PATCH xserver 1/2] Xi: Fix passive XI2 ungrabs on XIAll[Master]Devices

Peter Hutterer peter.hutterer at who-t.net
Thu Sep 1 21:44:06 PDT 2011


On Wed, Aug 31, 2011 at 12:46:52AM +0200, carlosg at gnome.org wrote:
> From: Carlos Garnacho <carlosg at gnome.org>
> 
> The corresponding DeviceIntPtr wasn't being gotten properly,
> resulting in BadDevice from dixLookupDevice().
> 
> Signed-off-by: Carlos Garnacho <carlosg at gnome.org>
> ---
>  Xi/xipassivegrab.c |   13 ++++++++++---
>  1 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c
> index ae43433..5cdd8ac 100644
> --- a/Xi/xipassivegrab.c
> +++ b/Xi/xipassivegrab.c
> @@ -261,9 +261,16 @@ ProcXIPassiveUngrabDevice(ClientPtr client)
>      REQUEST(xXIPassiveUngrabDeviceReq);
>      REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq);
>  
> -    rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
> -    if (rc != Success)
> -	return rc;
> +    if (stuff->deviceid == XIAllDevices)
> +        dev = inputInfo.all_devices;
> +    else if (stuff->deviceid == XIAllMasterDevices)
> +        dev = inputInfo.all_master_devices;
> +    else
> +    {
> +        rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
> +        if (rc != Success)
> +	    return rc;
> +    }
>  
>      if (stuff->grab_type != XIGrabtypeButton &&
>          stuff->grab_type != XIGrabtypeKeycode &&
> -- 
> 1.7.6

Merged into my -next branch, thanks

Cheers,
  Peter


More information about the xorg-devel mailing list