[Xcb] Opening/closing (and resizing) many windows

Edder edder at tkwsping.nl
Tue Aug 2 09:19:27 PDT 2011


Hi all,

I am building a plot library based on cairo and xcb.
(Available at https://gitorious.org/realtimeplot) (branch xcb).

Mostly this seems fine, but for some reason sometimes when I open a
couple of plots at almost the same time some of them don't show up (no
window is opened). This is always solved by sleeping between opening
those windows. I have tracked down this issue and found that the
problem is caused by my xcb code. The problem seems to happen more
commonly within xmonad (a tiling window manager) and therefore might
have something to do with the fact that xmonad resizes/moves the
window as soon as it is opened. Anyway some code that causes it to
happen a lot for me can be found here:
https://gitorious.org/realtimeplot/realtimeplot/blobs/xcb/examples/xcb_base.cc
(compile with gcc examples/xcb_base.cc -lxcb -lpthread)
This code should result in 4 open windows, but often only opens 1,2 or 3.

Am I doing something wrong with my xcb initialization?

Cheers,

Edwin

P.S. I had exactly the same problem with xlib, which is why I decided
to port to xcb


More information about the Xcb mailing list