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

Peter Hutterer peter.hutterer at who-t.net
Wed May 11 17:36:11 PDT 2011


On Wed, May 11, 2011 at 02:11:56PM -0700, Jamey Sharp wrote:
> 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.

amended, thanks.

Cheers,
  Peter
 
> 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




More information about the xorg-devel mailing list