[cairo] Cairo and multiple X11 windows

Carl Worth cworth at cworth.org
Thu Jul 31 10:22:40 PDT 2008

On Thu, 2008-07-31 at 18:34 +0200, W.Boeke wrote:
> A normal application with a GUI may contain hundreds of small windows.
> If I want to place text in these windows using Cairo, am I supposed
> to instantiate a surface and a context for each individual window?
> And if so, must I use cairo_set_source_rgb(), cairo_select_font_face()
> and cairo_set_font_size() for each context? 

Yes, that's what you would do.

> I suppose that I missed something, cause this can't be true ...

I don't see why not. Are you running into some practical problem with
this kind of approach?

Note that many modern toolkits don't use the "hundreds of small windows"
approach with X at all. It's mostly just one window these days. And that
approach does work better, (makes things like smooth window
layout/resizing actually feasible for example).

But I wouldn't anticipate any real problem from using cairo with a
toolkit/application that does use many windows.


More information about the cairo mailing list