/* Integration test against an isolated X server; never uses the physical display. */ #define _POSIX_C_SOURCE 200809L #include #include #include #include #include #include #include #include #include static Display *d; static void pause_tick(void) { struct timespec ts={0,100000000}; nanosleep(&ts,NULL); } static void key(KeySym sym) { KeyCode code=XKeysymToKeycode(d,sym); XTestFakeKeyEvent(d,code,True,CurrentTime); XTestFakeKeyEvent(d,code,False,CurrentTime); XFlush(d); } static Window find_rail(void) { Window root,parent,*children=NULL,result=None; unsigned n=0; XQueryTree(d,DefaultRootWindow(d),&root,&parent,&children,&n); for(unsigned i=0;i