[PATCH 3/4] dix: Simplify arguments to dixLookupDrawable

Soeren Sandmann sandmann at cs.au.dk
Mon Mar 7 15:27:13 PST 2011


Adam Jackson <ajax at redhat.com> writes:

> The mask argument was almost always 0 or (equivalently) M_ANY. 

Are they actually equivalent? If you pass 0, then the code uses
M_DRAWABLE, which actually means "drawable, which is not an InputOnly
window". But if you pass M_ANY, then InputOnly windows are also
returned, as they have resource class RC_DRAWABLE too.

The patch makes dixLookupDrawble() behave as if M_ANY was passed, but
code that passed 0 would need an additional check that the returned
drawable was not an InputOnly window.

Alternatively, maybe dixLookupDrawable() could be changed to never
return InputOnly windows, and then have a new function called something
like dixLookupAnyDrawable() or something.

A few other notes: It looks to me like the GLX checks go from BadMatch
to BadPixmap/BadWindow - which is what the spec says, so the change is
correct. It might be worthwhile doing such bug fixes separately from
formatting changes though.


Soren


More information about the xorg-devel mailing list