[cairo] Cairo and multiple X11 windows

Pete pete at shinners.org
Fri Aug 1 11:16:07 PDT 2008


Owen Taylor <otaylor <at> redhat.com> writes:
> On Fri, 2008-08-01 at 12:13 -0400, Jim Gettys wrote:
> > 
> > On Fri, 2008-08-01 at 15:30 +0200, W.Boeke wrote:
> > > 
> > > Are you shure that creating many windows in X is inefficient? My program
> > > instantiates 100's of them, still the graphics are fast, even on an old
> > > slow box and on the Asus eeePC. Running the 'top' command reveals that the
> > > CPU is hardly occupied by the graphics, only when a window must be redrawn
> > > because it is becoming less obscured by other windows. In this case
> > > it probably makes no difference whether you have one big window or many
> > > subwindows however.
> > 
> > Subwindows in X are indeed quite efficient.
> > 
> > But most of the modern tookits (e.g. Qt, GTK+) are cross platform, and
> > written therefore to work despite the lack of efficient subwindows on
> > other platforms.... Ergo the decline in subwindow's use...
> 
> Also, rectangular opaque boxes are not as popular in user interfaces as
> they once were.
> 
> Yes, you can get alpha compositing with subwindows if the application 
> acts as a compositing manager for its own subwindows, but there's a lot
> of complexity there, and portability becomes even sticker.
> 
> Much easier usually to just draw whatever you want into a single window.

Qt4.4 has finally ditched the "X window per widget" notion. It has definitely
hurt their performance for the past few years. Creating, scrolling, and
destroying widgets has never been fast enough. Of course, this was a gigantic
upheaval for a point release. It seems yesterday's 4.4.1 release fixes most of
the little problems.

This also allows a lot of new flexibility in the toolkit, such as placing
Windows onto canvases with arbitrary transform matrices.




More information about the cairo mailing list