[Xcb] Wrong value_mask type in for ConfigureWindow?

Antoine Latter aslatter at gmail.com
Tue Jan 13 11:16:26 PST 2009


On Tue, Jan 13, 2009 at 12:33 PM, Peter Harris <pharris at opentext.com> wrote:
> Friedrich Weber wrote:
>> I'm currently experimenting with the xcb-proto protocol description
>> files and xcbgen in order to create another Python binding. I've had
>> some trouble getting the `ConfigureWindow` request running (crashed with
>> a BadValue error), and it seems like the `ConfigureWindow` request has a
>> wrong value-mask-type set in xproto.xml (it's CARD16 at the moment).
>>
>> The Core X Protocol documentation
>> (http://www.xfree86.org/current/proto.pdf) specifies BITMASK as a CARD32
>> on page 115. However, it reserves only 2 Bytes for the bitmask for the
>> ConfigureWindow request (see page 125), followed by 2 unused bytes.
>> In order to 'fix' that, I changed the value-mask-type from CARD16 to
>> CARD32, and the generated bindings did their job properly. However, I am
>> very unsure if that change will work on other machines, because it looks
>> like a dirty hack ;)
>>
>> What do you think about that?
>
> I think it is not only a dirty hack, but also wrong.
>
> On an LSB-first connection, a CARD32 should be identical to
> CARD16+pad(2). So I strongly suspect your binding generator is busted.
> Maybe you forgot the pad(2) part?
>
> That, and it obviously won't work on an MSB machine after your change.
>

I thought this was fixed in proto-1.3?  The HEAD version of xproto.xml states:

>>>>>
<request name="ConfigureWindow" opcode="12">
 <pad bytes="1" />
 <field type="WINDOW" name="window" />
 <valueparam value-mask-type="CARD16"
 value-mask-name="value_mask"
 value-mask-pad="2"
 value-list-name="value_list" />
</request>
<<<<<

For ConfigureWindow (and ConfigureWindow alone) we send down 2 bytes
of mask followed by 2 bytes of padding, and then the value-list.

-Antoine


More information about the Xcb mailing list