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

2011-05-11 Thread Peter Hutterer
On Wed, May 11, 2011 at 02:11:56PM -0700, Jamey Sharp wrote:
> That's clearly a win.
> 
> Reviewed-by: Jamey Sharp 
> 
> 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 
> > ---
> >  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@lists.x.org: X.Org development
> > Archives: http://lists.x.org/archives/xorg-devel
> > Info: http://lists.x.org/mailman/listinfo/xorg-devel


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


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

2011-05-11 Thread Jamey Sharp
That's clearly a win.

Reviewed-by: Jamey Sharp 

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 
> ---
>  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@lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel


signature.asc
Description: Digital signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

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

2011-05-10 Thread Peter Hutterer
Rather than 3 conditions with if (deliveries && ...), have one block with
the three in them.
No functional changes.

Signed-off-by: Peter Hutterer 
---
 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@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel