[cairo] Empty surface creation

Bill Spitzak spitzak at d2.com
Wed Dec 21 10:14:37 PST 2005

Is this due to X refusing to create a zero-dimensioned window?

If so, what I have found works best is to make the code at the very low 
level, where it calls X, change any window dimensions that are zero or 
negative to 1. However the rest of the code continues to store and use 
the zero or negative dimensions. In effect glitz or whatever really does 
support empty surfaces.

This avoids a huge number of tests elsewhere to see if the window 
actually exists before passing it's id to X. These tests are slow and 
waste code, but more importantly I don't like them because they are 
misleading, making anybody examining the code believe they are a common 
occurrance, rather than an attempt to work around a defect in X.

Benoit Perrot wrote:
> I've investigated one ("clip-all") of the failing tests on glitz backend
> and it fails because the backend is asked to create an empty surface, ie
> a surface of 0 width and 0 height.

More information about the cairo mailing list