Allow for non-blocking dispatch of replies
This is a feature request. In libwayland there is a concept of "listeners" that route incoming messages to a dispatch table, filled in with callbacks by the user. It would be nice if this could happen in xcb so that blocking xcb_wait_for_reply
calls become unnecessary. It seems like a user could emulate this somewhat by keeping track of all cookies and then iterating through all of them, calling xcb_poll_for_reply
on them after polling input from the fd. However it would probably be nicer if xcb handled the dispatch so it could be kept to a single lookup in the replies map. That would mean adding a function like this:
int xcb_listen_for_reply(xcb_connection_t *c, unsigned int request, void (*on_reply)(void *reply, xcb_generic_error_t *error));
Does this sound like a good idea? Are there any other ways this can be done?