5 XSetWindowAttributes xswa;
6 unsigned long xswamask;
10 int x=10,y=10,h=100,w=400;
12 display = XOpenDisplay(NULL);
14 if (display == NULL) {
15 fprintf(stderr, "couldn't connect to X server :0\n");
19 xswa.override_redirect = True;
20 xswamask = CWOverrideRedirect;
22 win = XCreateWindow(display, RootWindow(display, 0),
23 x, y, w, h, 10, CopyFromParent, CopyFromParent,
24 CopyFromParent, xswamask, &xswa);
26 XSetWindowBackground(display,win,WhitePixel(display,0));
28 XMapWindow(display, win);
31 XUnmapWindow(display, win);
34 XMapWindow(display, win);
37 XSelectInput(display, win, ExposureMask | StructureNotifyMask);
40 XNextEvent(display, &report);
42 switch (report.type) {
47 x = report.xconfigure.x;
48 y = report.xconfigure.y;
49 w = report.xconfigure.width;
50 h = report.xconfigure.height;
51 printf("confignotify %i,%i-%ix%i\n",x,y,w,h);