[PATCH] Move event filter initializer out of the structure itself
Peter Hutterer
peter.hutterer at who-t.net
Mon May 2 22:49:45 PDT 2011
On Sun, Apr 24, 2011 at 12:55:05PM -0700, Alan Coopersmith wrote:
> On 04/22/11 11:10 PM, Jamey Sharp wrote:
> > On Fri, Apr 22, 2011 at 10:19:39PM -0700, Alan Coopersmith wrote:
> >> When kept in the structure, it causes the entire MAXDEVICES * 128 masks
> >> to be stored in the data segment and loaded from the file, and also leads
> >> to worries about later generations inheriting changes across server reset.
> >
> > Seems sensible to me, and also seems like a correctness fix:
> >
> >> - /* The mask for pointer motion events may have changed in the last server
> >> - * generation. See comment above definition of filters. */
> >> - filters[0][PointerMotionMask] = MotionNotify;
> >
> > This looks like it was backwards, before. If I'm not mistaken, this
> > array is supposed to be indexed by event numbers, and contain values
> > that are masks, right?
> >
> > So this patch, deleting that broken assignment and simplifying the rest
> > of the code, strikes me as good all around.
>
> Right - that was bothering me a bit, but I couldn't figure out why.
> It looks like the swap was made in f44d7dcb when the structure was
> replicated per device instead of being shared by all:
>
> - filters[MotionNotify] = PointerMotionMask;
> + filters[0][PointerMotionMask] = MotionNotify;
oops. I think I just confused index and value. this definitely looks like a
bug to me.
Cheers,
Peter
More information about the xorg-devel
mailing list