ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/x11.c
(Generate patch)

Comparing ray/src/rt/x11.c (file contents):
Revision 1.7 by greg, Fri Feb 23 14:50:38 1990 UTC vs.
Revision 1.9 by greg, Fri Mar 2 10:08:01 1990 UTC

# Line 85 | Line 85 | char  *name, *id;
85          int  nplanes;
86          XVisualInfo  ourvinfo;
87          XWMHints  ourxwmhints;
88        Pixmap  bmCursorSrc, bmCursorMsk;
88  
89          ourdisplay = XOpenDisplay(NULL);
90          if (ourdisplay == NULL) {
# Line 152 | Line 151 | x11_close()                    /* close our display */
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;
# Line 184 | Line 181 | int  xres, yres;
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 */
# Line 223 | Line 221 | int  xmin, ymin, xmax, ymax;
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();
# Line 253 | Line 251 | char  *out;
251   {
252          if (comline != NULL)
253                  xt_puts(out, comline);
256        XFlush(ourdisplay);
254   }
255  
256  
# Line 261 | Line 258 | static
258   x11_errout(msg)                 /* output an error message */
259   char  *msg;
260   {
264        x11_comout(msg);
261          stderr_v(msg);          /* send to stderr also! */
262 +        x11_comout(msg);
263 +        x11_flush();
264   }
265  
266  
# Line 375 | Line 373 | freepixels()                           /* free our pixels */
373                  return;
374          XFreeColors(ourdisplay,ourmap,pixval,ncolors,0L);
375          ncolors = 0;
376 <        if (ourmap != 0 && ourmap != DefaultColormap(ourdisplay,ourscreen))
376 >        if (ourmap != DefaultColormap(ourdisplay,ourscreen))
377                  XFreeColormap(ourdisplay, ourmap);
378          ourmap = 0;
379   }
# Line 442 | Line 440 | static
440   getkey(ekey)                            /* get input key */
441   register XKeyPressedEvent  *ekey;
442   {
443 <        int  n;
443 >        register int  n;
444  
445          n = XLookupString(ekey, c_queue+c_last, sizeof(c_queue)-c_last,
446                                  NULL, NULL);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines