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.2 by greg, Fri Jan 12 11:33:05 1990 UTC vs.
Revision 1.18 by greg, Fri Apr 19 15:02:54 1991 UTC

# Line 5 | Line 5 | static char SCCSid[] = "$SunId$ LBL";
5   /* Copyright (c) 1989 Regents of the University of California */
6  
7   /*
8 < *  x11.c - driver for X-windows version 10.4
8 > *  x11.c - driver for X-windows version 11.3
9   *
10 < *     1989
10 > *     Jan 1990
11   */
12  
13   #include  <stdio.h>
# Line 15 | Line 15 | static char SCCSid[] = "$SunId$ LBL";
15   #include  <sys/ioctl.h>
16  
17   #include  <X11/Xlib.h>
18 < #include <X11/cursorfont.h>
19 < #include <X11/Xutil.h>
18 > #include  <X11/cursorfont.h>
19 > #include  <X11/Xutil.h>
20  
21   #include  "color.h"
22   #include  "driver.h"
23   #include  "x11twind.h"
24 + #include  "x11icon.h"
25  
26   #define GAMMA           2.2             /* exponent for color correction */
27  
28 + #define MINWIDTH        (32*COMCW)      /* minimum graphics window width */
29 + #define MINHEIGHT       MINWIDTH        /* minimum graphics window height */
30 +
31   #define BORWIDTH        5               /* border width */
32   #define COMHEIGHT       (COMLH*COMCH)   /* command line height (pixels) */
33  
# Line 32 | Line 36 | static char SCCSid[] = "$SunId$ LBL";
36   #define COMCW           8               /* approx. character width (pixels) */
37   #define COMCH           14              /* approx. character height (pixels) */
38  
39 < #ifndef WFLUSH
40 < #define WFLUSH          30              /* flush after this many rays */
41 < #endif
39 > #define  ourscreen      DefaultScreen(ourdisplay)
40 > #define  ourroot        RootWindow(ourdisplay,ourscreen)
41 > #define  ourwhite       WhitePixel(ourdisplay,ourscreen)
42 > #define  ourblack       BlackPixel(ourdisplay,ourscreen)
43  
44 < #define  checkinp()     while (XPending(ourdisplay) > 0) getevent()
44 > #define  levptr(etype)  ((etype *)&currentevent)
45  
46 < #define  levptr(etype)  ((etype *)&thisevent)
46 > static XEvent  currentevent;            /* current event */
47  
43 static char  *clientname;               /* calling client's name */
44
45 static XEvent  thisevent;               /* current event */
46
48   static int  ncolors = 0;                /* color table size */
49 < static int  *pixval = NULL;             /* allocated pixels */
49 > static unsigned long  *pixval = NULL;   /* allocated pixels */
50  
51   static Display  *ourdisplay = NULL;     /* our display */
52  
53 + static Visual  *ourvisual;              /* our visual structure */
54 +
55   static Window  gwind = 0;               /* our graphics window */
56  
57   static Cursor  pickcursor = 0;          /* cursor used for picking */
58  
59 < static int  gwidth = 0;                 /* graphics window width */
57 < static int  gheight = 0;                /* graphics window height */
59 > static int  gwidth, gheight;            /* graphics window size */
60  
61   static TEXTWIND  *comline = NULL;       /* our command line */
62  
# Line 64 | Line 66 | static int  c_last = 0;                        /* last character in queue *
66  
67   static GC  ourgc = 0;                   /* our graphics context for drawing */
68  
69 < static Colormap ourmap;                 /* our color map */
69 > static Colormap ourmap = 0;             /* our color map */
70  
71 < extern char  *malloc();
71 > extern char  *malloc(), *getcombuf();
72  
73 < int  x11_close(), x11_clear(), x11_paintr(), x11_errout(),
74 <                x11_getcur(), x11_comout(), x11_comin();
73 > static int  x11_close(), x11_clear(), x11_paintr(), x11_errout(),
74 >                x11_getcur(), x11_comout(), x11_comin(), x11_flush();
75  
76   static struct driver  x11_driver = {
77          x11_close, x11_clear, x11_paintr, x11_getcur,
78 <        x11_comout, x11_comin, 1.0
78 >        x11_comout, x11_comin, x11_flush, 1.0
79   };
80  
81  
# Line 81 | Line 83 | struct driver *
83   x11_init(name, id)              /* initialize driver */
84   char  *name, *id;
85   {
86 <        Pixmap  bmCursorSrc, bmCursorMsk;
86 >        int  nplanes;
87 >        XVisualInfo  ourvinfo;
88 >        XSetWindowAttributes    ourwinattr;
89 >        XWMHints  ourxwmhints;
90 >        XSizeHints      oursizhints;
91  
92          ourdisplay = XOpenDisplay(NULL);
93          if (ourdisplay == NULL) {
94                  stderr_v("cannot open X-windows; DISPLAY variable set?\n");
95                  return(NULL);
96          }
97 <        if (DisplayPlanes(ourdisplay, DefaultScreen(ourdisplay)) < 4) {
97 >        nplanes = DisplayPlanes(ourdisplay, ourscreen);
98 >        if (nplanes < 4) {
99                  stderr_v("not enough colors\n");
100                  return(NULL);
101 +        } else if (nplanes <= 12) {
102 +                if (!XMatchVisualInfo(ourdisplay,ourscreen,
103 +                                nplanes,PseudoColor,&ourvinfo)) {
104 +                        stderr_v("PseudoColor server required\n");
105 +                        return(NULL);
106 +                }
107 +        } else if (!XMatchVisualInfo(ourdisplay,ourscreen,
108 +                        nplanes,TrueColor,&ourvinfo) &&
109 +                                                /* kludge for DirectColor */
110 +                        !XMatchVisualInfo(ourdisplay,ourscreen,
111 +                        nplanes,DirectColor,&ourvinfo)) {
112 +                stderr_v("TrueColor server required\n");
113 +                return(NULL);
114          }
115 <        ourmap = DefaultColormap(ourdisplay,DefaultScreen(ourdisplay));
116 <        make_gmap(GAMMA);                       /* make color map */
117 <        /*
118 <        bmCursorSrc = XCreateBitmapFromData(ourdisplay,
119 <                        gwind, bcross_bits,
120 <                        bcross_width, bcross_height);
121 <        bmCursorMsk = XCreateBitmapFromData(ourdisplay,
122 <                        gwind, bcross_mask_bits,
123 <                        bcross_width, bcross_height);
124 <
125 <        pickcursor = XCreatePixmapCursor(ourdisplay,
126 <                        bmCursorSrc, bmCursorMsk,
127 <                        BlackPixel(ourdisplay,
128 <                        DefaultScreen(ourdisplay)),
129 <                        WhitePixel(ourdisplay,
110 <                        DefaultScreen(ourdisplay)),
111 <                        bcross_x_hot, bcross_y_hot);
112 <        XFreePixmap(ourdisplay, bmCursorSrc);
113 <        XFreePixmap(ourdisplay, bmCursorMsk);
114 <        */
115 >        ourvisual = ourvinfo.visual;
116 >        make_gmap(GAMMA);
117 >        /* open window */
118 >        ourwinattr.background_pixel = ourblack;
119 >        ourwinattr.border_pixel = ourblack;
120 >        gwind = XCreateWindow(ourdisplay, ourroot, 0, 0,
121 >                DisplayWidth(ourdisplay,ourscreen)-2*BORWIDTH,
122 >                DisplayHeight(ourdisplay,ourscreen)-2*BORWIDTH,
123 >                BORWIDTH, nplanes, InputOutput, ourvisual,
124 >                CWBackPixel|CWBorderPixel, &ourwinattr);
125 >        if (gwind == 0) {
126 >                stderr_v("cannot create window\n");
127 >                return(NULL);
128 >        }
129 >        XStoreName(ourdisplay, gwind, id);
130          /* create a cursor */
131 <        pickcursor = XCreateFontCursor (ourdisplay, XC_diamond_cross);
132 <        /*  new */
133 <        clientname = id;
134 <        x11_driver.xsiz = DisplayWidth(ourdisplay,DefaultScreen(ourdisplay))
135 <                        - 2*BORWIDTH;
136 <        x11_driver.ysiz = DisplayHeight(ourdisplay,DefaultScreen(ourdisplay))
137 <                        - (COMHEIGHT + 2*BORWIDTH);
131 >        pickcursor = XCreateFontCursor(ourdisplay, XC_diamond_cross);
132 >        ourgc = XCreateGC(ourdisplay, gwind, 0, NULL);
133 >        ourxwmhints.flags = InputHint|IconPixmapHint;
134 >        ourxwmhints.input = True;
135 >        ourxwmhints.icon_pixmap = XCreateBitmapFromData(ourdisplay,
136 >                        gwind, x11icon_bits, x11icon_width, x11icon_height);
137 >        XSetWMHints(ourdisplay, gwind, &ourxwmhints);
138 >        oursizhints.min_width = MINWIDTH;
139 >        oursizhints.min_height = MINHEIGHT+COMHEIGHT;
140 >        oursizhints.flags = PMinSize;
141 >        XSetNormalHints(ourdisplay, gwind, &oursizhints);
142 >        XSelectInput(ourdisplay, gwind, ExposureMask);
143 >        XMapWindow(ourdisplay, gwind);
144 >        XWindowEvent(ourdisplay, gwind, ExposureMask, levptr(XEvent));
145 >        gwidth = levptr(XExposeEvent)->width;
146 >        gheight = levptr(XExposeEvent)->height - COMHEIGHT;
147 >        x11_driver.xsiz = gwidth < MINWIDTH ? MINWIDTH : gwidth;
148 >        x11_driver.ysiz = gheight < MINHEIGHT ? MINHEIGHT : gheight;
149          x11_driver.inpready = 0;
150          cmdvec = x11_comout;                    /* set error vectors */
151          if (wrnvec != NULL)
# Line 140 | Line 166 | x11_close()                    /* close our display */
166                  xt_close(comline);
167                  comline = NULL;
168          }
143        if (gwind != 0) {
144                XFreeGC(ourdisplay, ourgc);
145                XDestroyWindow(ourdisplay, gwind);
146                gwind = 0;
147                gwidth = gheight = 0;
148                ourgc = 0;
149        }
150        XFreeCursor(ourdisplay, pickcursor);
169          freepixels();
170 +        XFreeGC(ourdisplay, ourgc);
171 +        XDestroyWindow(ourdisplay, gwind);
172 +        gwind = 0;
173 +        ourgc = 0;
174 +        XFreeCursor(ourdisplay, pickcursor);
175          XCloseDisplay(ourdisplay);
176          ourdisplay = NULL;
177   }
# Line 158 | Line 181 | static
181   x11_clear(xres, yres)                   /* clear our display */
182   int  xres, yres;
183   {
184 <        XWMHints  ourxwmhints;
185 <        XSetWindowAttributes ourwindowattr;
186 <
187 <        if (xres != gwidth || yres != gheight) {        /* change window */
188 <                if (comline != NULL)
189 <                        xt_close(comline);
190 <                if (gwind == 0) {                       /* new window */
191 <                        ourwindowattr.backing_store = Always;
192 <                        ourwindowattr.background_pixel =
170 <                        WhitePixel(ourdisplay, DefaultScreen(ourdisplay));
171 <                        ourwindowattr.border_pixel =
172 <                        BlackPixel(ourdisplay, DefaultScreen(ourdisplay));
173 <                        gwind = XCreateWindow(ourdisplay,
174 <                                RootWindow(ourdisplay,
175 <                                DefaultScreen(ourdisplay)),
176 <                                0, 0, xres, yres+COMHEIGHT, BORWIDTH,
177 <                                0, InputOutput, CopyFromParent,
178 <                                CWBackingStore|CWBackPixel|CWBorderPixel,
179 <                                &ourwindowattr);
180 <                        if (gwind == 0)
181 <                                goto fail;
182 <                        XStoreName(ourdisplay, gwind, clientname);
183 <                        ourgc = XCreateGC(ourdisplay, gwind, 0, NULL);
184 <                        ourxwmhints.flags = InputHint;
185 <                        ourxwmhints.input = True;
186 <                        XSetWMHints(ourdisplay, gwind, &ourxwmhints);
187 <                        XSelectInput(ourdisplay, gwind,
188 <                                     KeyPressMask|ButtonPressMask);
189 <                        XMapWindow(ourdisplay, gwind);
190 <                } else                                  /* resize window */
191 <                        XResizeWindow(ourdisplay, gwind, xres, yres+COMHEIGHT);
192 <                comline = xt_open(ourdisplay,
193 <                                DefaultGC(ourdisplay,DefaultScreen(ourdisplay)),
194 <                                gwind, 0, yres, xres, COMHEIGHT, 0, COMFN);
195 <                if (comline == NULL)
196 <                        goto fail;
184 >                                                /* check limits */
185 >        if (xres < MINWIDTH)
186 >                xres = MINWIDTH;
187 >        if (yres < MINHEIGHT)
188 >                yres = MINHEIGHT;
189 >                                                /* resize window */
190 >        if (xres != gwidth || yres != gheight) {
191 >                XSelectInput(ourdisplay, gwind, 0);
192 >                XResizeWindow(ourdisplay, gwind, xres, yres+COMHEIGHT);
193                  gwidth = xres;
194                  gheight = yres;
195 <        } else                                          /* just clear */
196 <                XClearWindow(ourdisplay, gwind);
195 >                XFlush(ourdisplay);
196 >                sleep(2);                       /* wait for window manager */
197 >                XSync(ourdisplay, 1);           /* discard input */
198 >        }
199 >        XClearWindow(ourdisplay, gwind);
200                                                  /* reinitialize color table */
201 <        if (ncolors == 0 && getpixels() == 0)
202 <                stderr_v("cannot allocate colors\n");
203 <        else
204 <                new_ctab(ncolors);
205 <        return;
206 < fail:
207 <        stderr_v("Failure opening window in x11_clear\n");
208 <        quit(1);
201 >        if (ourvisual->class == PseudoColor)
202 >                if (getpixels() == 0)
203 >                        stderr_v("cannot allocate colors\n");
204 >                else
205 >                        new_ctab(ncolors);
206 >                                                /* get new command line */
207 >        if (comline != NULL)
208 >                xt_close(comline);
209 >        comline = xt_open(ourdisplay,
210 >                        DefaultGC(ourdisplay,ourscreen),
211 >                        gwind, 0, gheight, gwidth, COMHEIGHT, 0, COMFN);
212 >        if (comline == NULL) {
213 >                stderr_v("Cannot open command line window\n");
214 >                quit(1);
215 >        }
216 >        XSelectInput(ourdisplay, comline->w, ExposureMask);
217 >                                                /* remove earmuffs */
218 >        XSelectInput(ourdisplay, gwind,
219 >                StructureNotifyMask|ExposureMask|KeyPressMask|ButtonPressMask);
220   }
221  
222  
# Line 215 | Line 225 | x11_paintr(col, xmin, ymin, xmax, ymax)                /* fill a rec
225   COLOR  col;
226   int  xmin, ymin, xmax, ymax;
227   {
218        extern long  nrays;             /* global ray count */
228          extern int  xnewcolr();         /* pixel assignment routine */
229 <        static long  lastflush = 0;     /* ray count at last flush */
229 >        extern unsigned long  true_pixel();
230 >        unsigned long  pixel;
231  
232 <        if (ncolors > 0) {
233 <                XSetForeground(ourdisplay, ourgc,
234 <                                pixval[get_pixel(col, xnewcolr)]);
235 <                XFillRectangle(ourdisplay, gwind,
236 <                        ourgc, xmin, gheight-ymax, xmax-xmin, ymax-ymin);
237 <        }
238 <        if (nrays - lastflush >= WFLUSH) {
239 <                if (ncolors <= 0)       /* output necessary for death */
240 <                        XFillRectangle(ourdisplay, gwind,
231 <                                        ourgc, 0, 0, 1 ,1);
232 <                checkinp();
233 <                lastflush = nrays;
234 <        }
232 >        if (ncolors > 0)
233 >                pixel = pixval[get_pixel(col, xnewcolr)];
234 >        else if (ourvisual->class != PseudoColor)
235 >                pixel = true_pixel(col);
236 >        else
237 >                return;
238 >        XSetForeground(ourdisplay, ourgc, pixel);
239 >        XFillRectangle(ourdisplay, gwind,
240 >                ourgc, xmin, gheight-ymax, xmax-xmin, ymax-ymin);
241   }
242  
243  
244   static
245 < x11_comin(inp)                  /* read in a command line */
240 < char  *inp;
245 > x11_flush()                     /* flush output */
246   {
247 <        int  x11_getc(), x11_comout();
247 >        XNoOp(ourdisplay);
248 >        while (XPending(ourdisplay) > 0)
249 >                getevent();
250 > }
251  
252 +
253 + static
254 + x11_comin(inp, prompt)          /* read in a command line */
255 + char  *inp, *prompt;
256 + {
257 +        extern int  x11_getc();
258 +
259 +        if (prompt != NULL)
260 +                if (fromcombuf(inp, &x11_driver))
261 +                        return;
262 +                else
263 +                        xt_puts(prompt, comline);
264          xt_cursor(comline, TBLKCURS);
265          editline(inp, x11_getc, x11_comout);
266          xt_cursor(comline, TNOCURS);
# Line 251 | Line 271 | static
271   x11_comout(out)                 /* output a string to command line */
272   char  *out;
273   {
274 <        if (comline != NULL)
275 <                xt_puts(out, comline);
276 <        XFlush(ourdisplay);
274 >        if (comline == NULL)
275 >                return;
276 >        xt_puts(out, comline);
277 >        if (out[strlen(out)-1] == '\n')
278 >                XFlush(ourdisplay);
279   }
280  
281  
# Line 261 | Line 283 | static
283   x11_errout(msg)                 /* output an error message */
284   char  *msg;
285   {
264        x11_comout(msg);
286          stderr_v(msg);          /* send to stderr also! */
287 +        x11_comout(msg);
288   }
289  
290  
# Line 317 | Line 339 | int  r, g, b;
339   static int
340   getpixels()                             /* get the color map */
341   {
342 <        Visual  *ourvis = DefaultVisual(ourdisplay,DefaultScreen(ourdisplay));
342 >        XColor  thiscolor;
343 >        register int  i, j;
344  
345 <        freepixels();
346 <        for (ncolors=(ourvis->map_entries)-3; ncolors>12; ncolors=ncolors*.937){
347 <                pixval = (int *)malloc(ncolors*sizeof(int));
345 >        if (ncolors > 0)
346 >                goto donecolors;
347 >        if (ourvisual == DefaultVisual(ourdisplay,ourscreen)) {
348 >                ourmap = DefaultColormap(ourdisplay,ourscreen);
349 >                goto loop;
350 >        }
351 > newmap:
352 >        ourmap = XCreateColormap(ourdisplay,gwind,ourvisual,AllocNone);
353 > loop:
354 >        for (ncolors = ourvisual->map_entries;
355 >                        ncolors > ourvisual->map_entries/3;
356 >                        ncolors = ncolors*.937) {
357 >                pixval = (unsigned long *)malloc(ncolors*sizeof(unsigned long));
358                  if (pixval == NULL)
359 <                        break;
359 >                        return(ncolors = 0);
360                  if (XAllocColorCells(ourdisplay,ourmap,0,NULL,0,
361                                  pixval,ncolors) != 0)
362 <                        return(ncolors);
362 >                        break;
363                  free((char *)pixval);
364 +                pixval = NULL;
365          }
366 <        return(ncolors = 0);
366 >        if (pixval == NULL) {
367 >                if (ourmap == DefaultColormap(ourdisplay,ourscreen))
368 >                        goto newmap;            /* try it with our map */
369 >                else
370 >                        return(ncolors = 0);    /* failed */
371 >        }
372 >        if (ourmap != DefaultColormap(ourdisplay,ourscreen))
373 >                for (i = 0; i < ncolors; i++) { /* reset black and white */
374 >                        if (pixval[i] != ourblack && pixval[i] != ourwhite)
375 >                                continue;
376 >                        thiscolor.pixel = pixval[i];
377 >                        thiscolor.flags = DoRed|DoGreen|DoBlue;
378 >                        XQueryColor(ourdisplay,
379 >                                        DefaultColormap(ourdisplay,ourscreen),
380 >                                        &thiscolor);
381 >                        XStoreColor(ourdisplay, ourmap, &thiscolor);
382 >                        for (j = i; j+1 < ncolors; j++)
383 >                                pixval[j] = pixval[j+1];
384 >                        ncolors--;
385 >                        i--;
386 >                }
387 >        XSetWindowColormap(ourdisplay, gwind, ourmap);
388 > donecolors:
389 > #ifdef  DEBUG
390 >        thiscolor.flags = DoRed|DoGreen|DoBlue;
391 >        thiscolor.red = thiscolor.green = thiscolor.blue = 0;
392 >        for (i = 0; i < ncolors; i++) {
393 >                thiscolor.pixel = pixval[i];
394 >                XStoreColor(ourdisplay, ourmap, &thiscolor);
395 >        }
396 > #endif
397 >        return(ncolors);
398   }
399  
400  
# Line 340 | Line 405 | freepixels()                           /* free our pixels */
405                  return;
406          XFreeColors(ourdisplay,ourmap,pixval,ncolors,0L);
407          ncolors = 0;
408 +        if (ourmap != DefaultColormap(ourdisplay,ourscreen))
409 +                XFreeColormap(ourdisplay, ourmap);
410 +        ourmap = 0;
411   }
412  
413  
414 + static unsigned long
415 + true_pixel(col)                 /* return true pixel value for color */
416 + COLOR  col;
417 + {
418 +        unsigned long  rval;
419 +        BYTE  rgb[3];
420 +
421 +        map_color(rgb, col);
422 +        rval = ourvisual->red_mask*rgb[RED]/255 & ourvisual->red_mask;
423 +        rval |= ourvisual->green_mask*rgb[GRN]/255 & ourvisual->green_mask;
424 +        rval |= ourvisual->blue_mask*rgb[BLU]/255 & ourvisual->blue_mask;
425 +        return(rval);
426 + }
427 +
428 +
429   static int
430   x11_getc()                      /* get a command character */
431   {
# Line 360 | Line 443 | getevent()                     /* get next event */
443   {
444          XNextEvent(ourdisplay, levptr(XEvent));
445          switch (levptr(XEvent)->type) {
446 +        case ConfigureNotify:
447 +                resizewindow(levptr(XConfigureEvent));
448 +                break;
449 +        case UnmapNotify:
450 +                freepixels();
451 +                break;
452 +        case MapNotify:
453 +                if (ourvisual->class == PseudoColor)
454 +                        if (getpixels() == 0)
455 +                                stderr_v("Cannot allocate colors\n");
456 +                        else
457 +                                new_ctab(ncolors);
458 +                break;
459 +        case Expose:
460 +                fixwindow(levptr(XExposeEvent));
461 +                break;
462          case KeyPress:
463                  getkey(levptr(XKeyPressedEvent));
464                  break;
# Line 373 | Line 472 | static
472   getkey(ekey)                            /* get input key */
473   register XKeyPressedEvent  *ekey;
474   {
475 <        c_last += XLookupString(ekey, c_queue+c_last, sizeof(c_queue)-c_last,
475 >        register int  n;
476 >
477 >        n = XLookupString(ekey, c_queue+c_last, sizeof(c_queue)-c_last,
478                                  NULL, NULL);
479 <        x11_driver.inpready = c_last-c_first;
479 >        c_last += n;
480 >        x11_driver.inpready += n;
481   }
482  
483  
382 #ifdef notdef
484   static
485   fixwindow(eexp)                         /* repair damage to window */
486   register XExposeEvent  *eexp;
487   {
488 <        if (eexp->subwindow == 0)
489 <                repaint(eexp->x, gheight - eexp->y - eexp->height,
488 >        if (eexp->window == gwind) {
489 >                sprintf(getcombuf(&x11_driver), "repaint %d %d %d %d\n",
490 >                        eexp->x, gheight - eexp->y - eexp->height,
491                          eexp->x + eexp->width, gheight - eexp->y);
492 <        else if (eexp->subwindow == comline->w)
493 <                xt_redraw(comline);
492 >        } else if (eexp->window == comline->w) {
493 >                if (eexp->count == 0)
494 >                        xt_redraw(comline);
495 >        }
496   }
497 < #endif
497 >
498 >
499 > static
500 > resizewindow(ersz)                      /* resize window */
501 > register XConfigureEvent  *ersz;
502 > {
503 >        if (ersz->width == gwidth && ersz->height-COMHEIGHT == gheight)
504 >                return;
505 >
506 >        gwidth = ersz->width;
507 >        gheight = ersz->height-COMHEIGHT;
508 >        x11_driver.xsiz = gwidth < MINWIDTH ? MINWIDTH : gwidth;
509 >        x11_driver.ysiz = gheight < MINHEIGHT ? MINHEIGHT : gheight;
510 >
511 >        strcpy(getcombuf(&x11_driver), "new\n");
512 > }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines