[Xcb] xcb_composite_redirect_window NEVER replies

Peter Harris peter at harr.ca
Tue Nov 3 19:05:24 PST 2015


On 3 November 2015 at 18:33, Juan Lao Tebar wrote:
>
> I'm trying to redirect the first child of the root window, but it seems that
> the X server never replies after calling xcb_composite_redirect_window.
>
> I attach my code. This my output:
>
> $ g++ test.cpp -lxcb -lxcb-composite && ./a.out
> Composite extension found!
> Redirecting child 31457352
> Waiting for response...
>
> (and it never ends)
>
> Am I doing anything wrong here?

You're waiting for a reply to a request that doesn't actually have a
reply. See http://cgit.freedesktop.org/xorg/proto/compositeproto/tree/compositeproto.txt
(the requests with a reply have a -> delimiter between the request
structure and the reply structure).

> void* reply = xcb_wait_for_reply(c, redirectCookie.sequence, NULL);

Most XCB code only uses the request-specific reply functions, not the
generic xcb_wait_for_reply. If you use
xcb_composite_redirect_window_reply next time, you will (a) avoid the
void pointer and an unsafe cast, and (b) notice immediately when the
compiler tells you there is no xcb_composite_redirect_window_reply()
function.

Peter Harris


More information about the Xcb mailing list