[PATCH] Count the number of logically down buttons in buttonsDown

Peter Hutterer peter.hutterer at who-t.net
Thu Jan 15 17:47:55 PST 2009


On Thu, Jan 15, 2009 at 08:22:17PM -0500, Thomas Jaeger wrote:
> From d6ea6d45d5d3ca74bb665f32439f440b30a8939d Mon Sep 17 00:00:00 2001
> From: Thomas Jaeger <ThJaeger at gmail.com>
> Date: Sat, 20 Dec 2008 16:17:02 +0100
> Subject: [PATCH] Don't release grabs unless all buttons are up
> 
> Previously, only buttons <= 5 would count here, but the core protocol
> allows for 255 buttons.
> 
> http://lists.freedesktop.org/archives/xorg/2009-January/042092.html

Pushed, thanks again.

Cheers,
  Peter

> ---
>  Xi/exevents.c |    2 +-
>  dix/events.c  |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Xi/exevents.c b/Xi/exevents.c
> index f3f9d39..6bf9e56 100644
> --- a/Xi/exevents.c
> +++ b/Xi/exevents.c
> @@ -1118,7 +1118,7 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
>  	    xE->u.u.detail = key;
>  	    return;
>  	}
> -        if (!b->state && device->deviceGrab.fromPassiveGrab)
> +        if (!b->buttonsDown && device->deviceGrab.fromPassiveGrab)
>              deactivateDeviceGrab = TRUE;
>      }
>  
> diff --git a/dix/events.c b/dix/events.c
> index a042089..e23cf8f 100644
> --- a/dix/events.c
> +++ b/dix/events.c
> @@ -3929,7 +3929,7 @@ ProcessPointerEvent (xEvent *xE, DeviceIntPtr mouse, int count)
>  	    if (xE->u.u.detail == 0)
>  		return;
>              filters[mouse->id][Motion_Filter(butc)] = MotionNotify;
> -	    if (!butc->state && mouse->deviceGrab.fromPassiveGrab)
> +	    if (!butc->buttonsDown && mouse->deviceGrab.fromPassiveGrab)
>  		deactivateGrab = TRUE;
>  	    break;
>  	default:
> -- 
> 1.6.0.6




More information about the xorg mailing list