[Xcb] Callback based event handling
psychon at znc.in
Thu Feb 23 03:26:01 PST 2012
On 23.02.2012 10:51, Erik Karlsson wrote:
> I just returned to a small project of mine which used the callback
> based event handling of xcb-event.
> This has been removed as of commit
> The commit message discourages use of this library, and I then wonder,
> what is the preferred method of handling XCB events?
You could just reimplement that code yourself. It is just a simple switch()
based on the event type.
For an example of how something else was handled, here is the corresponding
commit for the awesome window manager (The chunk in event.c might be the most
interesting to you):
For getting events, you would then call libxcb's function, e.g.
xcb_poll_for_event() (possibly in a loop) instead of
As you see from that commit, the xcb-event library didn't actually save much
code and due to the indirection it was certainly slower. Hence it was removed.
"Engineering - where the semi-skilled laborers execute the vision
of those who think and dream. Hello Oompa-Loompas of science."
More information about the Xcb