#include #include #include Display *d; Window w; Screen s; int main(void) { XEvent evt; char s[80]; clock_t clk; int screen; d = XOpenDisplay(NULL); printf("%d\n", WidthMMOfScreen(DefaultScreenOfDisplay(d))); w = XCreateSimpleWindow(d, DefaultRootWindow(d), 1, 1, 500, 375, 0, 0x0000ff, 0xff0000); if (! w) { printf("Error creating window!\n"); exit(1); } XMapWindow(d, w); clk = clock(); while(1) { while(XPending(d)) XNextEvent(d, &evt); if ((clock() - clk) >= 5000000) break; } XDestroyWindow(d, w); XCloseDisplay(d); } .