Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request From: quasar@ctt.bellcore.com (Laurence R. Brothers) Newsgroups: comp.sys.sun Subject: drawing to the root window (hack hack) Keywords: Windows Message-ID: <14728@bellcore.bellcore.com> Date: 31 Mar 89 11:32:10 GMT Sender: usenet@rice.edu Organization: Computer Technology Transfer, Bellcore Lines: 27 Approved: Sun-Spots@rice.edu Original-Date: 14 Mar 89 22:51:46 GMT X-Sun-Spots-Digest: Volume 7, Issue 219, message 11 of 16 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@ctt.bellcore.com) Bellcore -- Computer Technology Transfer -- Knowledge-Based Systems Development