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.win_gravity = StaticGravity;
20 xswamask = CWWinGravity;
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 XSelectInput(display, win, ExposureMask | StructureNotifyMask);
34 XNextEvent(display, &report);
36 switch (report.type) {
41 x = report.xconfigure.x;
42 y = report.xconfigure.y;
43 w = report.xconfigure.width;
44 h = report.xconfigure.height;
45 printf("confignotify %i,%i-%ix%i\n",x,y,w,h);