147 |
|
greyscale = !greyscale; |
148 |
|
break; |
149 |
|
case 'm': |
150 |
+ |
greyscale = 1; |
151 |
|
maxcolors = 2; |
152 |
|
break; |
153 |
|
case 'd': |
302 |
|
} |
303 |
|
} |
304 |
|
/* open window */ |
305 |
+ |
i = CWEventMask|CWCursor|CWBackPixel|CWBorderPixel; |
306 |
|
ourwinattr.border_pixel = ourwhite; |
307 |
|
ourwinattr.background_pixel = ourblack; |
308 |
< |
ourwinattr.colormap = XCreateColormap(thedisplay, ourroot, |
309 |
< |
ourvis.visual, AllocNone); |
308 |
> |
if (ourvis.visual != DefaultVisual(thedisplay,ourscreen)) { |
309 |
> |
ourwinattr.colormap = newcmap(thedisplay, ourscreen, ourvis.visual); |
310 |
> |
i |= CWColormap; |
311 |
> |
} |
312 |
|
ourwinattr.event_mask = ExposureMask|KeyPressMask|ButtonPressMask| |
313 |
|
ButtonReleaseMask|ButtonMotionMask|StructureNotifyMask; |
314 |
|
ourwinattr.cursor = XCreateFontCursor(thedisplay, XC_diamond_cross); |
315 |
|
wind = XCreateWindow(thedisplay, ourroot, xszhints.x, xszhints.y, |
316 |
|
xszhints.width, xszhints.height, BORWIDTH, |
317 |
< |
ourvis.depth, InputOutput, ourvis.visual, CWEventMask| |
318 |
< |
CWCursor|CWBackPixel|CWBorderPixel|CWColormap, &ourwinattr); |
317 |
> |
ourvis.depth, InputOutput, ourvis.visual, |
318 |
> |
i, &ourwinattr); |
319 |
|
if (wind == 0) |
320 |
|
quiterr("cannot create window"); |
321 |
|
width = xmax; |