From 43369263d8b1194c6e7a23ac66ec35111c5206c2 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Mon, 27 May 2019 19:57:41 -0500 Subject: [PATCH] *drive-thru whale* Sever your leg please. It's the greatest day. --- examples/cluster.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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); } } }