drawing to the root window (hack hack)

Laurence R. Brothers quasar at ctt.bellcore.com
Fri Mar 31 21:32:10 AEST 1989


I've written a few hacks to draw stuff on the root window (I'm on a
Sun-4/260, OS 4.0, by the way). I open /dev/win0 and then pw_open the fd I
get. I now want to retain the pixwin I'm drawing to so as to automatically
handle damage. I presume the original root pixwin is retained, since it
does in fact handle damage.  I've fiddled with the pw_prretained pixrect
field of the root pixwin without success. I've tried a number of different
tacks, already, so I'd appreciate it if any suggestions anyone makes are
tested first...

As a digression, I should mention that there is approximately a 25%
failure chance for a program whose first two executable lines are:

  root_fd = open("/dev/win0");
  root_pixwin = pw_open(root_fd);

If it doesn't work, either root_fd is set to -1, (error "file already
exists") or pw_open fails to work and returns NULL. Somehow, the success
of a program is dependent on the structure of the rest of the source code
-- i.e., a given source file will either always work, or always not work.
Changing the file may randomly change this state -- any ideas? Giving open
its second argument seems to have no effect on this behavior.

Incidentally, using dbx on one of these programs causes it automatically
to fail to open /dev/win0, returning -1, so it is kind of hard to debug....

	    Laurence R. Brothers (quasar at ctt.bellcore.com)
Bellcore -- Computer Technology Transfer -- Knowledge-Based Systems Development



More information about the Comp.sys.sun mailing list