[Xcb] EWMH API for XCB

Arnaud Fontaine arnaud at andesi.org
Sun Dec 13 05:31:45 PST 2009


During the summer, I began writing an XCB library for EWMH as part of my
project about  writing an  XCB compositing manager  (which I'm  about to
release soon even  if it's not finished yet).  I  have now just finished
writing xcb-util/ewmh library (after spending  a lot of time cleaning up
and checking the code) and it's available there[0] (xcb-ewmh branch).

It provides an  API to easily deal with EWMH in  an asynchronous way and
is  just a  straight implementation  of EWMH  specification  version 1.4
draft-2[1].  I  will keep  maintaining this library  as it's  needed for
Awesome and the compositing manager I'm currently working on.

Of  course,   it  introduces  several   new  types,  and   most  notably
xcb_ewmh_connection_t structure which holds the connection to a display,
its root window  and all the EWMH atoms,  plus UTF8_STRING, WM_PROTOCOLS
and  MANAGER.  All  the  functions  and  types  have  been  prefixed  by
'xcb_ewmh_' to avoid polluting the namespace.

I know the code might look a  bit hard to read at first sight because of
macros and  M4 (the latter has been  actually used only for  the list of
atoms), however,  not using macros  and M4 would  have mean a  much more
ugly code and especially harder to maintain.

Anyway, if  some people  could review the  code before committing  it to
xcb-util main repository,  it would help a lot... I  think I will commit
it soon if nobody complains of course.

Arnaud Fontaine

[0] http://cgit.freedesktop.org/~arnau/xcb-util/
[1] http://standards.freedesktop.org/wm-spec/wm-spec-1.4.html

More information about the Xcb mailing list