[PATCH 13/17] input: replace remaining GetPairedDevice() with GetMaster()

Daniel Stone daniel at fooishbar.org
Mon Aug 8 02:36:35 PDT 2011


Hi,

On Mon, Aug 08, 2011 at 04:21:09PM +1000, Peter Hutterer wrote:
> --- a/Xi/xiquerypointer.c
> +++ b/Xi/xiquerypointer.c
> @@ -110,10 +110,9 @@ ProcXIQueryPointer(ClientPtr client)
>      if (pDev->valuator->motionHintWindow)
>          MaybeStopHint(pDev, client);
>  
> -    if (IsMaster(pDev))
> -        kbd = GetPairedDevice(pDev);
> -    else
> -        kbd = (pDev->key) ? pDev : NULL;
> +    kbd = GetMaster(pDev, KEYBOARD_OR_FLOAT);
> +    if (!kbd->key)
> +        kbd = NULL;

Isn't this a behaviour change, in that it will now find the master
keyboard, whereas before it was the master keyboard if the device was a
master pointer, or the device's keyboard if it was a slave, or nothing?

> --- a/dix/events.c
> +++ b/dix/events.c
> @@ -3606,10 +3606,7 @@ CheckPassiveGrabsOnWindow(
>  	gdev= grab->modifierDevice;
>          if (grab->grabtype == GRABTYPE_CORE)
>          {
> -            if (IsPointerDevice(device))
> -                gdev = GetPairedDevice(device);
> -            else
> -                gdev = device;
> +            gdev = IsFloating(device) ? gdev : GetMaster(device, MASTER_KEYBOARD);

Errr ... :)

> diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
> index 4b5405a..c1e70e8 100644
> --- a/xkb/xkbActions.c
> +++ b/xkb/xkbActions.c
> @@ -1200,7 +1200,7 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev);
>  	if (keyEvent)
>              tmpdev = dev;
>          else
> -            tmpdev = GetPairedDevice(dev);
> +            tmpdev = GetMaster(dev, KEYBOARD_OR_FLOAT);

This should be POINTER_OR_FLOAT, as the aim is to get something with
dev->valuator if you've just triggered a pointer event from an XKB
action.

With those fixed:
Reviewed-by: Daniel Stone <daniel at fooishbar.org>

Cheers,
Daniel


More information about the xorg-devel mailing list