[PATCH xinput] Handle XA_CARDINAL as property type

Peter Hutterer peter.hutterer at who-t.net
Tue Feb 21 14:27:08 PST 2012


On Tue, Feb 21, 2012 at 03:43:52PM -0500, James Cloos wrote:
> >>>>> "PH" == Peter Hutterer <peter.hutterer at who-t.net> writes:
> 
> I didn't look in any real detail, but shouldn't the types and percents
> be the same in each block?  Eg:
> 
> PH> +                        case 32:
> PH> +                            printf("%lu", *((unsigned long*)ptr));
> PH> +                            break;
> 
> PH> +                        case 32:
> PH> +                            printf("%u", *((uint32_t*)ptr));
> PH> +                            break;

in theory yes, but not in this case, this is a bit of the property API. the
core and XI 1.x property API exports 32-bit properties as longs. which
causes a bit of hilarity on the client-side as you can imagine.

XI2 32-bit properties are actually 32 bits, hence uint32_t.

Cheers,
  Peter


More information about the xorg-devel mailing list