[Xcb] [EXTERNAL] - Attempt at writing a tutorial

Uli Schlachter psychon at znc.in
Fri Feb 12 05:32:00 UTC 2021


Hi,

pad0 is just padding: There is a hole in the structure that is not used
for anything.
XCB_REQUEST_RAW... well, if you really need to know:
All X11 requests have a major opcode and all extension requests have a
minor opcode. These are just numbers that tell the X11 server which
request we are sending. There is also a length field inside each X11
request that tells the X11 server, well, the length of the request.
These fields are automatically set by libxcb and do not have to be set
by the caller. If you specify XCB_REQUEST_RAW on a request, then this
signals that these fields are already set and libxcb should not touch
them, but just sent "the bytes" directly to the server.

Cheers,
Uli

Am 12.02.21 um 02:39 schrieb Lucas:
> I believe that I found the rest of the answers for everything except for
> what the flag XCB_REQUEST_RAW does:
> 
> XCB_REQUEST_CHECKED (tells the server to provide the error, if any,
> inside a/reply/to a given request), XCB_REQUEST_DISCARD_REPLY (tells X
> to discard the reply, if any, to a given request), and
> XCB_REQUEST_REPLY_FDS (tells the server to include the number of socket
> file descriptors inside the reply to a given request,this appears to be
> for internal usage only
> <https://gitlab.freedesktop.org/xorg/lib/libxcb/-/blob/master/src/xcb_in.c#L246>).
> Member of the struct xcb_unmap_window_request_t pad0 may store the
> number of socket file descriptors depending on the request.
> 
> 
> On 11/02/2021 14:58, Lucas Augusto Valentim Dantas wrote:
>> Thank you very much! I will ruminate more on this and read on error
>> handling and events until I can write something intelligible about this.
>> Meanwhile I would like to point out that the struct I was talking
>> about has the following members: major_opcode, pad0 (no idea what this
>> is nor how it is used), length (length of the request?), and window (I
>> kknow this is supposed to reference the window that is supposed to be
>> unmapped).
>>
>> https://xcb.freedesktop.org/manual/structxcb__unmap__window__request__t.html
>>
>> It also appears here
>> https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Desktop-generic/LSB-Desktop-generic/libxcb-ddefs.html
>>
>>
>> ------------------------------------------------------------------------
>> *De:* Uli Schlachter <psychon at znc.in>
>> *Enviado:* quinta-feira, 11 de fevereiro de 2021 14:37
>> *Para:* Lucas Augusto Valentim Dantas <lucasvalentim at outlook.com.br>;
>> xcb at lists.freedesktop.org <xcb at lists.freedesktop.org>
>> *Assunto:* Re: [Xcb] [EXTERNAL] - Attempt at writing a tutorial
>> Hi,
>>
>> checked vs unchecked requests are explained here (under the heading of
>> the same name):
>>
>> https://www.systutorials.com/docs/linux/man/3-xcb-requests/
>>
>> The short version is: This only makes a difference for X11 error
>> handling. With unchecked requests, any errors show up as events in e.g.
>> xcb_wait_for_event(). With checked requests, errors are provided when
>> getting the reply (or calling xcb_check_request()).
>>
>> Cheers,
>> Uli
>>
>> Am 11.02.21 um 18:28 schrieb Lucas Augusto Valentim Dantas:
>> > I found those values by looking into the source code, probably
>> libxcb's, since they are passed to the second argument of the function
>> xcb_send_request(), as can be seen here (although the "sequence"
>> argument is gone already):
>> https://xcb.freedesktop.org/ProtocolExtensionApi/#index3h2 but that
>> page doesn't explain what they do.
>> > My goal with this tutorial is to provide enough for the reader to
>> understand the X documentation so he is able to "navigate" on his own,
>> that is what I am trying to do myself.
>> > ________________________________
>> > De: Peter Harris <pharris at opentext.com>
>> > Enviado: quinta-feira, 11 de fevereiro de 2021 14:15
>> > Para: Lucas <lucasvalentim at outlook.com.br>;
>> xcb at lists.freedesktop.org <xcb at lists.freedesktop.org>
>> > Assunto: RE: [EXTERNAL] - [Xcb] Attempt at writing a tutorial
>> >
>> > On 2021-02-10 Lucas wrote:
>> >> I am writing a XCB tutorial as an exercise, so far, this is what I
>> >> have https://biteiro.ga/xcb.html
>> >>
>> >> There are a few things I couldn't find details yet, such as what does
>> >> the flags XCB_REQUEST_CHECKED, XCB_REQUEST_RAW,
>> >> XCB_REQUEST_DISCARD_REPLY, and XCB_REQUEST_REPLY_FDS do?
>> >
>> > Those values are for internal use by libxcb (and/or xlib), and are
>> not intended to be used by a normal user of libxcb.
>> >
>> > Who is your tutorial intended for? Showing the inner workings is
>> more of a "deep documentation" thing than a "tutorial" thing.
>> >
>> >> Are there any
>> >> explanations on the members of the struct xcb_unmap_window_request_t?
>> >
>> > libxcb is a thin wrapper around the X11 protocol. As such, the
>> documentation for those fields can be found at:
>> >
>> >
>> https://www.x.org/releases/X11R7.7/doc/xproto/x11protocol.html#request_format
>>
>> >
>> >
>> https://www.x.org/releases/X11R7.7/doc/xproto/x11protocol.html#requests:UnmapWindow
>>
>> >
>> > Peter Harris
>> >
>> >
>> > _______________________________________________
>> > Xcb mailing list
>> > Xcb at lists.freedesktop.org
>> > https://lists.freedesktop.org/mailman/listinfo/xcb
>> >
>>
>>
>> -- 
>> <alanc> I think someone had a Xprint version of glxgears at one point,
>>     but benchmarking how many GL pages you can print per second
>>     was deemed too silly to merge
>>
>> _______________________________________________
>> Xcb mailing list
>> Xcb at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/xcb
> 
> 
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/xcb
> 


-- 
Sent from my Game Boy.


More information about the Xcb mailing list