diff --git a/examples/cluster.c b/examples/cluster.c index 633eba8..9591d83 100644 --- a/examples/cluster.c +++ b/examples/cluster.c @@ -248,6 +248,8 @@ int main(int argc, char **argv) { .graphics_exposures = 0 }; + XdbeSwapInfo swapinfo; + cairo_surface_t *sfc; cairo_t *cr; @@ -266,9 +268,15 @@ int main(int argc, char **argv) { fd2 = ConnectionNumber(display); screen = DefaultScreen(display); - win = XCreateSimpleWindow(display, DefaultRootWindow(display), 0, 0, width, height, 0, 0, 0); - gc = XCreateGC(display, win, GCForeground | GCBackground | GCGraphicsExposures, &values); - bg = XCreatePixmap(display, win, width, height, 24); + + win = XCreateSimpleWindow(display, DefaultRootWindow(display), 0, 0, width, height, 0, 0, 0); + buf = XdbeAllocateBackBufferName(display, win, XdbeUntouched); + + swapinfo.swap_window = win; + swapinfo.swap_action = XdbeUntouched; + + gc = XCreateGC(display, win, GCForeground | GCBackground | GCGraphicsExposures, &values); + bg = XCreatePixmap(display, win, width, height, 24); /* * Draw the background layer @@ -342,6 +350,8 @@ int main(int argc, char **argv) { 0, 0); update_gauge_cluster(cr, &frame, 0, 0, width, height); + + XdbeSwapBuffers(display, &swapinfo, 1); } } }