| 85 |
|
int nplanes; |
| 86 |
|
XVisualInfo ourvinfo; |
| 87 |
|
XWMHints ourxwmhints; |
| 88 |
– |
Pixmap bmCursorSrc, bmCursorMsk; |
| 88 |
|
|
| 89 |
|
ourdisplay = XOpenDisplay(NULL); |
| 90 |
|
if (ourdisplay == NULL) { |
| 151 |
|
xt_close(comline); |
| 152 |
|
comline = NULL; |
| 153 |
|
} |
| 154 |
< |
if (gwind != 0) { |
| 155 |
< |
freepixels(); |
| 156 |
< |
XFreeGC(ourdisplay, ourgc); |
| 157 |
< |
XDestroyWindow(ourdisplay, gwind); |
| 158 |
< |
gwind = 0; |
| 160 |
< |
ourgc = 0; |
| 161 |
< |
} |
| 154 |
> |
freepixels(); |
| 155 |
> |
XFreeGC(ourdisplay, ourgc); |
| 156 |
> |
XDestroyWindow(ourdisplay, gwind); |
| 157 |
> |
gwind = 0; |
| 158 |
> |
ourgc = 0; |
| 159 |
|
XFreeCursor(ourdisplay, pickcursor); |
| 160 |
|
XCloseDisplay(ourdisplay); |
| 161 |
|
ourdisplay = NULL; |
| 181 |
|
XSelectInput(ourdisplay, comline->w, ExposureMask); |
| 182 |
|
gwidth = xres; |
| 183 |
|
gheight = yres; |
| 184 |
< |
XSync(ourdisplay, 1); /* discard input */ |
| 184 |
> |
XFlush(ourdisplay); |
| 185 |
|
sleep(2); /* wait for window manager */ |
| 186 |
+ |
XSync(ourdisplay, 1); /* discard input */ |
| 187 |
|
} |
| 188 |
|
XClearWindow(ourdisplay, gwind); |
| 189 |
|
if (ourvisual->class == PseudoColor) /* reinitialize color table */ |
| 221 |
|
static |
| 222 |
|
x11_flush() /* flush output */ |
| 223 |
|
{ |
| 224 |
< |
if (ncolors <= 0) /* output necessary for death */ |
| 224 |
> |
if (ncolors <= 0 && ourvisual->class != TrueColor) /* dummy */ |
| 225 |
|
XFillRectangle(ourdisplay, gwind, ourgc, 0, 0, 1 ,1); |
| 226 |
|
while (XPending(ourdisplay) > 0) |
| 227 |
|
getevent(); |
| 251 |
|
{ |
| 252 |
|
if (comline != NULL) |
| 253 |
|
xt_puts(out, comline); |
| 256 |
– |
XFlush(ourdisplay); |
| 254 |
|
} |
| 255 |
|
|
| 256 |
|
|
| 372 |
|
return; |
| 373 |
|
XFreeColors(ourdisplay,ourmap,pixval,ncolors,0L); |
| 374 |
|
ncolors = 0; |
| 375 |
< |
if (ourmap != 0 && ourmap != DefaultColormap(ourdisplay,ourscreen)) |
| 375 |
> |
if (ourmap != DefaultColormap(ourdisplay,ourscreen)) |
| 376 |
|
XFreeColormap(ourdisplay, ourmap); |
| 377 |
|
ourmap = 0; |
| 378 |
|
} |
| 439 |
|
getkey(ekey) /* get input key */ |
| 440 |
|
register XKeyPressedEvent *ekey; |
| 441 |
|
{ |
| 442 |
< |
int n; |
| 442 |
> |
register int n; |
| 443 |
|
|
| 444 |
|
n = XLookupString(ekey, c_queue+c_last, sizeof(c_queue)-c_last, |
| 445 |
|
NULL, NULL); |