#include #include #include #include /* * Thie program demonstrates that windows that have had * XcompositeRedirectSubwindows() called on them will * not have their background drawn at all. * * This is correct according to the composite spec, but I don't see any * good (API) reason for this behavior. The right * behavior in my opinion is to only have the background * painting turned off it is moving a redirected window that * causes the expose/paintbackground. Ie,. basically when the * expose is real, it should be processed. * * Think of an application for example that has a manual redirect * of the subwindows of its own toplevel window. */ static int comp_event; static int comp_error; static void disaster (const char *what) { fprintf (stderr, "Error: %s\n", what); exit (0); } int main (int argc, char **argv) { Display *dpy; Window main_window; dpy = XOpenDisplay (NULL); if (!XCompositeQueryExtension (dpy, &comp_event, &comp_error)) disaster ("No composite extension found\n"); /* Create main window */ main_window = XCreateSimpleWindow (dpy, XDefaultRootWindow (dpy), 100, 100, 600, 400, 0, 0, 0xffffffff); XMapWindow (dpy, main_window); XCompositeRedirectSubwindows (dpy, main_window, CompositeRedirectManual); XFlush (dpy); sleep (100); }