1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#include <X11/X.h> #include <X11/Xlib.h> #include <time.h> #include <assert.h> // // gcc -g test_xsync.c -lX11 -o test_xsync // int main() { // Open the display Display *dpy = XOpenDisplay(NULL); assert(dpy); // loop for ever while (1) { sleep(0); XSync(dpy, 0); } }