[PATCH] Always update master->u.lastSlave in mieqProcessDeviceEvent

Peter Hutterer peter.hutterer at who-t.net
Thu Jul 16 17:24:25 PDT 2009


On Thu, Jul 16, 2009 at 12:41:57PM +0200, Pierre Willenbrock wrote:
> Peter Hutterer schrieb:
> > On Tue, Jul 14, 2009 at 01:51:16PM +0200, Pierre Willenbrock wrote:
> >> This fixes pointer warping when using a scaled pointer input device(e.g.
> >> synaptics).
> >>
> >> By the way, having the dev->u.master check only in the "we have no
> >> handler" branch looks strange.
> > 
> > right, this should be in both of course. Care to send me a patch?
> > 
> [patch snipped]
> > 
> > ACK, can you please resend as a git-formatted patch? git am didn't like this
> > one.
> 
> Both patches in git-format-patch format attached.

> From b765ceed81974c1ce2c54cca270689948452b2bd Mon Sep 17 00:00:00 2001
> From: Pierre Willenbrock <pierre at pirsoft.de>
> Date: Tue, 14 Jul 2009 13:42:19 +0200
> Subject: [PATCH 1/2] Always update u.lastSlave
> 
> ---
>  mi/mieq.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/mi/mieq.c b/mi/mieq.c
> index 0f07b16..f050115 100644
> --- a/mi/mieq.c
> +++ b/mi/mieq.c
> @@ -390,17 +390,17 @@ mieqProcessDeviceEvent(DeviceIntPtr dev,
>      else {
>          master = CopyGetMasterEvent(dev, event, masterEvents);
>  
> +        if (master)
> +            master->u.lastSlave = dev;
> +
>          /* If someone's registered a custom event handler, let them
>           * steal it. */
>          if (handler)
>          {
>              handler(DequeueScreen(dev)->myNum, event, dev);
>              if (master)
> -            {
> -                master->u.lastSlave = dev;
>                  handler(DequeueScreen(master)->myNum,
>                          (InternalEvent*)masterEvents->event, master);
> -            }
>          } else
>          {
>              /* process slave first, then master */
> -- 
> 1.6.3.1
> 

> From 2ab51638124bc53cf41cce2c05b1bbe48b06ea1c Mon Sep 17 00:00:00 2001
> From: Pierre Willenbrock <pierre at pirsoft.de>
> Date: Thu, 16 Jul 2009 12:12:48 +0200
> Subject: [PATCH 2/2] Check dev->u.master if there is a custom event handler, too
> 
> ---
>  mi/mieq.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/mi/mieq.c b/mi/mieq.c
> index f050115..a17b07d 100644
> --- a/mi/mieq.c
> +++ b/mi/mieq.c
> @@ -398,7 +398,9 @@ mieqProcessDeviceEvent(DeviceIntPtr dev,
>          if (handler)
>          {
>              handler(DequeueScreen(dev)->myNum, event, dev);
> -            if (master)
> +            /* Check for the SD's master in case the device got detached
> +             * during event processing */
> +            if (master && dev->u.master)
>                  handler(DequeueScreen(master)->myNum,
>                          (InternalEvent*)masterEvents->event, master);
>          } else
> -- 
> 1.6.3.1
> 

applied, thanks. will be pushed with next load.

Cheers,
  Peter


More information about the xorg-devel mailing list