[comp.windows.x] Small change to xlock

naughton%wind@Sun.COM (Patrick Naughton) (02/23/89)

Niels Mayer from HP's Software Technology Lab sent me mail pointing out
that I hardcoded the number of colors in the colormap I was creating. 
Apparently he was running an X server on a 6 plane display so the 256
entry colormap allocation failed. 

It is a one line fix for those of you who are running on similar
displays.  I don't have an n < 8 plane display to test it on, but it ran
just fine on X11/NeWS with a 8 plane CG2.

Here's the diff:

33a34
>  * 22-Feb-89: Added fix for color servers with n < 8 planes.
536c537
<       if (XCreateHSBColormap(dsp, screen, &cmap, 256,
---
>       if (XCreateHSBColormap(dsp, screen, &cmap, DisplayCells(dsp, screen),


On a related note:

David Bryant from AT&T Bell Labs in Columbus sent me mail asking if the
new "xlock -saver" option was somehow connected to the X11 server screen
saver.  Sorry, but X defines the screen saver to be a server function,
such that any graphic display that the screen saver uses to protect the
screen must be compiled into the server.  It does not fork an X client
program to cover the screen.  Given the source to your server and the
inclination to do a little hacking, you could make the xlock "hopalong"
graphics be used as the server's screen saver (much the same way the X
logo is the current graphic), "xlock -saver" simply runs the same as
xlock without requiring a password from the user.

-Patrick
    ______________________________________________________________________
    Patrick J. Naughton				    ARPA: naughton@Sun.COM
    Window Systems Group			    UUCP: ...!sun!naughton
    Sun Microsystems, Inc.			    AT&T: (415) 336 - 1080