[PATCH 05/11] dix: move the grab activation condition into a if block.

Jamey Sharp jamey at minilop.net
Wed May 11 14:11:56 PDT 2011


That's clearly a win.

Reviewed-by: Jamey Sharp <jamey at minilop.net>

I'd replace "else { if ... }" with "else if ..." in the same patch, but
it doesn't matter.

Jamey

On Wed, May 11, 2011 at 02:49:44PM +1000, Peter Hutterer wrote:
> Rather than 3 conditions with if (deliveries && ...), have one block with
> the three in them.
> No functional changes.
> 
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
>  dix/events.c |   34 ++++++++++++++++++----------------
>  1 files changed, 18 insertions(+), 16 deletions(-)
> 
> diff --git a/dix/events.c b/dix/events.c
> index 35548ea..a8bfa72 100644
> --- a/dix/events.c
> +++ b/dix/events.c
> @@ -2181,24 +2181,26 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
>          }
>      }
>  
> -    /*
> -     * Note that since core events are delivered first, an implicit grab may
> -     * be activated on a core grab, stopping the XI events.
> -     */
> -    if (IsButtonPressEvent(pEvents) && deliveries && (!grab))
> -        ActivateImplicitGrab(pDev, client, pWin, pEvents, deliveryMask);
> -    else if ((type == MotionNotify) && deliveries)
> -	pDev->valuator->motionHintWindow = pWin;
> -    else
> -    {
> -	if ((type == DeviceMotionNotify || type == DeviceButtonPress) &&
> -	    deliveries)
> -	    CheckDeviceGrabAndHintWindow (pWin, type,
> -					  (deviceKeyButtonPointer*) pEvents,
> -					  grab, client, deliveryMask);
> -    }
>      if (deliveries)
> +    {
> +        /*
> +         * Note that since core events are delivered first, an implicit grab may
> +         * be activated on a core grab, stopping the XI events.
> +         */
> +        if (IsButtonPressEvent(pEvents) && (!grab))
> +            ActivateImplicitGrab(pDev, client, pWin, pEvents, deliveryMask);
> +        else if ((type == MotionNotify))
> +            pDev->valuator->motionHintWindow = pWin;
> +        else
> +        {
> +            if (type == DeviceMotionNotify || type == DeviceButtonPress)
> +                CheckDeviceGrabAndHintWindow (pWin, type,
> +                                              (deviceKeyButtonPointer*) pEvents,
> +                                              grab, client, deliveryMask);
> +        }
> +
>  	return deliveries;
> +    }
>      return nondeliveries;
>  }
>  
> -- 
> 1.7.4.4
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110511/e932bfe5/attachment-0001.pgp>


More information about the xorg-devel mailing list