--- ray/src/rt/x11.c 1993/06/04 14:48:52 2.12 +++ ray/src/rt/x11.c 1994/09/09 16:16:06 2.15 @@ -78,8 +78,8 @@ static struct driver x11_driver = { x11_comout, x11_comin, x11_flush, 1.0 }; -static int getpixels(), xnewcolr(), freepixels(), - getevent(), getkey(), fixwindow(); +static int getpixels(), xnewcolr(), freepixels(), resizewindow(), + getevent(), getkey(), fixwindow(), x11_getc(); static unsigned long true_pixel(); @@ -125,7 +125,8 @@ char *name, *id; ourwhite = WhitePixel(ourdisplay,ourscreen); } /* set gamma */ - if ((gv = getenv("GAMMA")) != NULL) + if ((gv = XGetDefault(ourdisplay, "radiance", "gamma")) != NULL + || (gv = getenv("GAMMA")) != NULL) make_gmap(atof(gv)); else make_gmap(GAMMA); @@ -260,9 +261,19 @@ int xmin, ymin, xmax, ymax; static x11_flush() /* flush output */ { + int n; + register char *buf; + XNoOp(ourdisplay); while (XPending(ourdisplay) > 0) getevent(); +#ifdef FIONREAD + if (ioctl(0, FIONREAD, &n) == 0 && n) { /* from stdin */ + buf = getcombuf(&x11_driver); + n = read(0, buf, n); + buf[n] = '\0'; + } +#endif } @@ -270,13 +281,12 @@ static x11_comin(inp, prompt) /* read in a command line */ char *inp, *prompt; { - extern int x11_getc(); - - if (prompt != NULL) + if (prompt != NULL) { + x11_flush(); /* make sure we get everything */ if (fromcombuf(inp, &x11_driver)) return; - else - xt_puts(prompt, comline); + xt_puts(prompt, comline); + } xt_cursor(comline, TBLKCURS); editline(inp, x11_getc, x11_comout); xt_cursor(comline, TNOCURS);