[Xcb] Setting the WM_TRANSIENT_FOR property on a window

Peter Harris pharris at opentext.com
Mon Mar 22 11:06:53 PDT 2010


On 2010-03-22 11:40, Arnaud Fontaine wrote:
>>>>>> Peter Harris <pharris at opentext.com> writes:
>     > iovec  lets you submit many  separate buffers as if  they were one
>     > large  one. It  is needed to  avoid allocating another  buffer and
>     > copying into it.
> 
> Sorry, my question was not clear.  I'm actually wondering why we need to
> read/write to multiple buffers in the xcb client library?  This may be a
> stupid question but I'm currently too tired to figure that out...

Consider PutImage. The request consists of the protocol header, the
BigReq header, the request body, and a large blob of data supplied by
the user. To send it all in one go, you can:

1) Allocate a new huge buffer, copy over the small protocol headers,
followed by the huge blob of data (flushing the Dcache an extra time,
and possibly going into swap on weak systems).

2) Use multiple separate write() requests (although this doesn't work so
well when you're trying to keep track of the X11 sequence number in
xcb_send_request - you'd need to add an extra flag for "request
continuation" or similar).

3) force the user to allocate larger buffers than strictly needed for
their image, so that libxcb can overwrite the space before the bits.
This interacts poorly with images allocated by 3rd party libraries, and
results in crashes for everyone who didn't read the manual carefully
(it's a really odd interface).

or

4) Just use writev (and percolate the iovec interface back up to
xcb_send_request).

Peter Harris
-- 
               Open Text Connectivity Solutions Group
Peter Harris                    http://connectivity.opentext.com/
Research and Development        Phone: +1 905 762 6001
pharris at opentext.com            Toll Free: 1 877 359 4866


More information about the Xcb mailing list