[PATCH] xinput: add set-prop command

Peter Hutterer peter.hutterer at who-t.net
Mon Apr 20 18:22:25 PDT 2009


On Mon, Apr 20, 2009 at 03:41:34PM +0200, Simon Thum wrote:
> Julien Cristau wrote:
>> On Mon, Apr 20, 2009 at 14:12:50 +0200, Simon Thum wrote:
>>
>>> Julien Cristau wrote:
>>>> v2: fixed the float handling for 64bit as Peter did for set-float-prop
>>> [...]
>>>> +    union {
>>>> +        unsigned char *c;
>>>> +        short *s;
>>>> +        long *l;
>>>> +        Atom *a;
>>>> +    } data;
>>> Wouldn't it be necessary to store Atoms long-aligned as well ?   
>>> (disclaimer: I did't look up the Atom definition, nor associated 
>>> specs)
>>>
>> On the client side, Atom is unsigned long, so that should be ok.
>>
>> One thing I'm wondering is if I should be more paranoid and also check
>> that format is 32 when type is FLOAT or ATOM.
> I'd say if the server does 'enforce' it, that's enough. We depend on a  
> sane server anyway :)

In regards to properties, the server doesn't really enforce anything.
properties are a storage mechanism and the X server will happily store
anything you tell it to.

The only exception are those properties handled in the server/driver because
the handlers will usually check for sanity. This doesn't apply to user-defined
properties however.

So yes - a sanity-checking patch would be much appreciated. If you can get the
patch to me on top of your current one, I'll just squash them together before
pushing.

Cheers,
  Peter


More information about the xorg-devel mailing list