84 |
|
{ |
85 |
|
int nplanes; |
86 |
|
XVisualInfo ourvinfo; |
87 |
+ |
XSetWindowAttributes ourwinattr; |
88 |
|
XWMHints ourxwmhints; |
89 |
|
|
90 |
|
ourdisplay = XOpenDisplay(NULL); |
109 |
|
} |
110 |
|
ourvisual = ourvinfo.visual; |
111 |
|
make_gmap(GAMMA); |
111 |
– |
/* create a cursor */ |
112 |
– |
pickcursor = XCreateFontCursor (ourdisplay, XC_diamond_cross); |
112 |
|
/* open window */ |
113 |
< |
gwind = XCreateSimpleWindow(ourdisplay, ourroot, 0, 0, |
113 |
> |
ourwinattr.background_pixel = ourwhite; |
114 |
> |
ourwinattr.border_pixel = ourblack; |
115 |
> |
gwind = XCreateWindow(ourdisplay, ourroot, 0, 0, |
116 |
|
DisplayWidth(ourdisplay,ourscreen)-2*BORWIDTH, |
117 |
|
DisplayHeight(ourdisplay,ourscreen)-2*BORWIDTH, |
118 |
< |
BORWIDTH, ourblack, ourwhite); |
118 |
> |
BORWIDTH, nplanes, InputOutput, ourvisual, |
119 |
> |
CWBackPixel|CWBorderPixel, &ourwinattr); |
120 |
|
if (gwind == 0) { |
121 |
|
stderr_v("cannot create window\n"); |
122 |
|
return(NULL); |
123 |
|
} |
124 |
|
XStoreName(ourdisplay, gwind, id); |
125 |
+ |
/* create a cursor */ |
126 |
+ |
pickcursor = XCreateFontCursor(ourdisplay, XC_diamond_cross); |
127 |
|
ourgc = XCreateGC(ourdisplay, gwind, 0, NULL); |
128 |
|
ourxwmhints.flags = InputHint; |
129 |
|
ourxwmhints.input = True; |
225 |
|
static |
226 |
|
x11_flush() /* flush output */ |
227 |
|
{ |
228 |
< |
if (ncolors <= 0 && ourvisual->class != TrueColor) /* dummy */ |
225 |
< |
XFillRectangle(ourdisplay, gwind, ourgc, 0, 0, 1 ,1); |
228 |
> |
XNoOp(ourdisplay); |
229 |
|
while (XPending(ourdisplay) > 0) |
230 |
|
getevent(); |
231 |
|
} |
252 |
|
x11_comout(out) /* output a string to command line */ |
253 |
|
char *out; |
254 |
|
{ |
255 |
< |
if (comline != NULL) |
256 |
< |
xt_puts(out, comline); |
255 |
> |
if (comline == NULL) |
256 |
> |
return; |
257 |
> |
xt_puts(out, comline); |
258 |
> |
if (out[strlen(out)-1] == '\n') |
259 |
> |
XFlush(ourdisplay); |
260 |
|
} |
261 |
|
|
262 |
|
|
266 |
|
{ |
267 |
|
stderr_v(msg); /* send to stderr also! */ |
268 |
|
x11_comout(msg); |
263 |
– |
x11_flush(); |
269 |
|
} |
270 |
|
|
271 |
|
|