[PATCH 24/42] dix: add helper functions to build up/verify the sprite trace

Peter Hutterer peter.hutterer at who-t.net
Tue Dec 20 15:36:19 PST 2011


On Wed, Dec 21, 2011 at 09:32:29AM +1000, Peter Hutterer wrote:
> On Mon, Dec 19, 2011 at 07:01:25PM -0800, Chase Douglas wrote:
> > On Dec 14, 2011, at 7:02 PM, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> > > From: Daniel Stone <daniel at fooishbar.org>
> > > 
> > > Touch events' sprite trace stays the same for the duration of the touch
> > > sequence.
> > > 
> > > Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> > > ---
> > > dix/touch.c     |   87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > > include/input.h |    4 ++
> > > 2 files changed, 91 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/dix/touch.c b/dix/touch.c
> > > index 78c50cf..90349bd 100644
> > > --- a/dix/touch.c
> > > +++ b/dix/touch.c
> > > @@ -500,3 +500,90 @@ TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev, XID resource)
> > >         /* FIXME: deliver the event */
> > >     }
> > > }
> > > +
> > > +Bool
> > > +TouchBuildSpriteTrace(DeviceIntPtr dev, SpritePtr sprite)
> > > +{
> > > +    int i;
> > > +    TouchClassPtr t = dev->touch;
> > > +    WindowPtr *trace;
> > > +    SpritePtr srcsprite;
> > > +
> > > +    /* Find and reuse an existing touch's sprite if possible, else use the
> > > +     * device's sprite. */
> > 
> > Why? I can't remember why we would want to prefer a touch sprite, in which
> > case we can simplify the next dozen lines.
> 
> Daniel? This is still leftover code from your original patch. My suspicion
> is that it's outdated from some point in the past when we sent all touches
> to the same window. I'll just remove it.

aargh, of course a minute after sending I understood it again. This function is
only called for dependent devices that use the device's sprite trace and all
touches always go to the same window (the one the sprite is in).

And we prefer the touch sprite so that all touches have the same sprite
trace, even if window reshuffling happens in the meantime.

This code is correct.

Cheers,
  Peter


More information about the xorg-devel mailing list