save-under support

Aaron Plattner aplattner at
Wed Feb 4 15:36:11 PST 2009

On Wed, Feb 04, 2009 at 02:17:32PM -0800, Adam Jackson wrote:
> On Thu, 2009-01-22 at 17:25 -0500, Patrick O'Donnell wrote:
> > I've been told, recently, that "save-under and backing-store under
> > 8-bit [visuals] are no longer supported in recent releases".  We
> > maintain several old X applications that make significant use of both
> > save-under and backing-store (and 8-bit PseudoColor visuals), and this
> > news greatly disturbs us.  However, in several days of searching, I
> > have been unable to find any definitive pronouncement that that is
> > truly the case.
> As mentioned downthread, bs and saveunders have never been guarantees,
> and did have real bugs that would require the application to correctly
> respond to Expose events.
> As a trivial workaround, you can enable compositing for your own windows
> with XCompositeRedirectSubwindows(dpy, win, CompositeRedirectAutomatic).
> If a compositing manager is active, this will have no effect; otherwise,
> it will behave essentially the same as bs's WhenMapped state, except,
> you know.  Good.

Just to nitpick, this isn't really true.  RedirectSubwindows will redirect
all the child windows of your main window, but not the main window itself,
resulting in extra pixmaps being created and a cascade of automatic updates
from the children to the parent whenever they're updated.  Even redirecting
the app's top-level window isn't a no-op, since a composite manager will
most likely redirects the frame window it creates and not the app's window
itself.  It should still work fine, you'll just get multiple levels of
redirection.  If you can get away with rendering to a pixmap and using
XSetWindowBackgroundPixmap, that'll probably be faster.

> I did attempt to emulate bs by doing this redirection in the server
> automagically but never quite got it right.  It's certainly not the goal
> to break applications just for fun, I'd love to see this working
> properly.  There's also some desire to add something like bs's Always
> state to Composite, but so far, nobody's stepped up with code.
> - ajax

More information about the xorg mailing list