Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!psuvax1!swatsun!jackiw From: jackiw@cs.swarthmore.edu (Nick Jackiw) Newsgroups: comp.sys.mac.programmer Subject: Re: desktop pictures.... Message-ID: Date: 17 Aug 90 03:52:28 GMT References: <107498@tiger.oxy.edu> Reply-To: jackiw@cs.swarthmore.edu (Nick Jackiw) Organization: Visual Geometry Project, Swarthmore College, PA Lines: 32 sonenbli@oxy.edu (Andrew D. Sonenblick) writes: > I was doing so lo level examination of codes and came accross > Tim Maroney's Backdrop code. I assumed that having a picture in place of > a pattern on the desktop would require a patch or two, so I looked at what > he patched. Woe! It appears that he patches FillRect and FillRgn to > achieve his functionality. Unfortunately I could not figure out exactly > how using these traps would enable him to replace the desktop. Does anyone > out in frontierland know how that mechanisms of this program work? If Tim's reading this, perhaps he'll step up and talk about this. In it's day, it was a very slick hack indeed... Spending a few minutes in MacNosy, it seems that Backdrop caches the bitmap which represents the screen picture somewhere while booting. It then installs patches to Fillrect and FillRgn, both of which Finder calls to redraw the default desktop pattern. When one of these traps is called, the patch determines if Finder called it to explicitly fill in the desktop pattern (by checking if the pattern is the desktop one, and some other magic I don't quite follow), and if it is, it instead _CopyBits the appropriate rect or region in from the cached bitmap. Ah for the days of problem free tail patches... -- ------------------------ Nick Jackiw jackiw@cs.swarthmore.edu "We are what we think, Visual Geometry Project jackiw@swarthmr.bitnet having become what we