Adding input masking to Composite extension
keithp at keithp.com
Fri Nov 23 16:27:32 PST 2007
To eliminate the need for computing an input shape for translucent
windows, it seems like just using the existing 'alpha' bits in the pixel
would make it very easy to do input hit detection.
Here's a couple of proposed additions to the Composite extension for
doing just that:
13. Input clipping (0.5 and later)
When determining whether the cursor is inside 'window', the pixel
value ('pixel') at the cursor location is fetched and tested:
bool pixel_is_inside (pixel, mask, upper, lower)
if (lower < upper)
return lower <= (pixel & mask) && upper < (pixel & mask)
return lower <= (pixel & mask) || upper < (pixel & mask)
This test provides an additional constraint on inclusion, so other
tests involving normal window occlusion must also be satisfied for
the pixel to be included.
All three of these values are zero by default, making the above
function always true.
This returns the current input mask values.
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 189 bytes
Desc: This is a digitally signed message part
More information about the xorg