XFixesCreateRegionFromXXX region redux

Keith Packard keithp@keithp.com
Fri, 05 Dec 2003 14:06:36 -0800


It's nice to play with a system for a while and discover the nits before 
shipping things for real.

I've been trying to eliminate (or at least limit) the errors generated by 
the compositing manager and have discovered one case that's causing 
cascading errors.  I'm using XFixesCreateRegionFromWindow to construct the 
area of the window to copy into the destination.  That's working fine when 
the windows aren't disappearing, but when they do, the request fails and 
the region ID just allocated ends up not referencing a valid region.  
Further uses of this region cause a cascade of errors.  Yuck.

A simple solution that I've come up with is to replace the 
CreateRegionFromXXX apis with CopyRegionFromXXX instead; the internal cost 
is identical.  Applications would then create an empty region object and 
copy the contents from the window; non-existant windows would result in 
empty regions and a single error, rather than an invalid region XID.

I can (obviously) simply add CopyRegionFromXXX requests to XFixes, but I'd 
rather remove the CreateRegionFromXXX requests at the same time.

Comments?

-keith