[Xcb] Qlength like in xcb

Arnaud Fontaine arnaud at andesi.org
Wed Feb 3 03:17:33 PST 2010


Hi,

Sorry for the late reply. I didn't see this thread ;).

>> i'm coding a simple compositing manager and i really miss something like
>> the Xlib QLength. This macro returns the length of the event queue. It is
>> really useful in a compositing manager to collect damaged areas and
redraw >> them only at the end.
>
> Arnaud Fontaine has already written an XCB based CM with a very good
> documentation.

I'm using a boolean stored in a global structure (`globalconf.do_repaint')
which is set to true when one of the following event is received (or when
a plugin explicitely set it to true)[0]:

UnmapNotify
PropertyNotify
DamageNotify

In my main event loop, firstly, I call xcb_wait_for_event() to block until
an event is in the queue, then I call xcb_event_poll_for_event_loop() to
process all the events in the queue and finally I "repaint" the screen
according to the value of `do_repaint'. It is quite basic but it works
well for now (ATM my CM is far from being optimized but I will work on
that soon). Does it help?

Michele: I'm about to announce an beta release of my compositing manager,
Unagi, after this week-end but you can have a look at the website which
provides code documentation[2]. I'm also looking for contributors, so you
are welcome if you are interested ;)!

Regards,
Arnaud

[0]
http://git.mini-dweeb.org/?p=arnau/unagi.git;a=blob;f=src/event.c;h=ffd46d4b833b3d09da08f97610519b36cde68726;hb=HEAD
[1]
http://git.mini-dweeb.org/?p=arnau/unagi.git;a=blob;f=src/unagi.c;h=18d8fb35715588fa257f374a791d64c94142226f;hb=HEAD#l366
[2] http://projects.mini-dweeb.org/projects/unagi



More information about the Xcb mailing list