[Xcb] Sending Keyboard Events with XTest

Uli Schlachter psychon at znc.in
Fri Jan 7 16:45:20 UTC 2022


On 06.01.22 16:58, icy_flurry wrote:
> How can I fix this?

Random guess: The connection is closed before the X11 server read your
latest requests. Basically (in terms of BSD socket API), your code does
a write() followed immediately by a close() of the socket. The other end
of the connection can handle the close() before all of the written data
was handled yet.

To fix this, make sure the X11 server really handled the request already:

free(xcb_get_input_focus_reply(c, xcb_get_input_focus(c), NULL));

or if you use xcb-aux


> Also, are there more complete docs for using XTest with XCB?

Google gave me [0], does that count?

Basically, with XCB you only need the "raw protocol" docs. XCB does not
do anything fancy above the actual on-the-wire protocol. Xlib sometimes


[0]: https://www.x.org/releases/X11R7.7/doc/xextproto/xtest.html
Sent from my Game Boy.

More information about the Xcb mailing list