6 XSetWindowAttributes xswa
;
7 unsigned long xswamask
;
11 int x
=10,y
=10,h
=100,w
=400;
14 display
= XOpenDisplay(NULL
);
16 if (display
== NULL
) {
17 fprintf(stderr
, "couldn't connect to X server :0\n");
21 xswa
.win_gravity
= StaticGravity
;
22 xswamask
= CWWinGravity
;
24 win
= XCreateWindow(display
, RootWindow(display
, 0),
25 x
, y
, w
, h
, 10, CopyFromParent
, CopyFromParent
,
26 CopyFromParent
, xswamask
, &xswa
);
28 XSetWindowBackground(display
,win
,WhitePixel(display
,0));
31 size
.min_aspect
.x
= 3;
32 size
.min_aspect
.y
= 3;
33 size
.max_aspect
.x
= 3;
34 size
.max_aspect
.y
= 3;
35 XSetWMNormalHints(display
, win
, &size
);
37 XMapWindow(display
, win
);
40 XSelectInput(display
, win
, ExposureMask
| StructureNotifyMask
);
43 XNextEvent(display
, &report
);
45 switch (report
.type
) {
50 x
= report
.xconfigure
.x
;
51 y
= report
.xconfigure
.y
;
52 w
= report
.xconfigure
.width
;
53 h
= report
.xconfigure
.height
;
54 printf("confignotify %i,%i-%ix%i\n",x
,y
,w
,h
);