[PATCH] Move event filter initializer out of the structure itself

Alan Coopersmith alan.coopersmith at oracle.com
Sun Apr 24 12:55:05 PDT 2011


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;

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list