Re: Sending Keyboard Events with XTest

Uli Schlachter <[email protected]> Fri, 7 Jan 2022 17:45:20 +0100
Newsgroups gmane.comp.freedesktop.xcb
Message-ID <[email protected]>
Hi,

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

xcb_aux_sync(c);

> 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
does.

Cheers,
Uli

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