[PATCH 2/6] Input: Don't freeze unrelated devices in DeliverGrabbedEvent

Daniel Stone daniel at fooishbar.org
Tue Feb 22 05:44:23 PST 2011


On Thu, Feb 17, 2011 at 09:13:07AM +1000, Peter Hutterer wrote:
> On Tue, Feb 15, 2011 at 08:11:25PM +0100, Simon Thum wrote:
> > On 02/15/2011 12:27 PM, Daniel Stone wrote:
> > > --- a/dix/events.c
> > > +++ b/dix/events.c
> > > @@ -3884,14 +3884,14 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
> > >  	case FREEZE_BOTH_NEXT_EVENT:
> > >  	    for (dev = inputInfo.devices; dev; dev = dev->next)
> > >  	    {
> > > -		if (dev == thisDev)
> > > +		if (dev == thisDev || dev != GetPairedDevice(thisDev))
> > >  		    continue;
> > I wonder if it's worth traversing the list since you know both devices.
> > Moving that into a function called twice instead of in a loop might help
> > readability. It also avoids repeated GetPairedDevice calls.
> 
> I agree with Simon, having a loop that only triggers on one device seems a
> bit excessive.

Just sent out the v2 of this patch -- had put a changelog in after git
format-patch, but went back to fix whitespace and accidentally stomped
the changelog, sorry.

Cheers,
Daniel
-------------- 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/20110222/dfa8ad3e/attachment.pgp>


More information about the xorg-devel mailing list