[comp.sys.mac.programmer] More screen saver woes....

CXT105@psuvm.psu.edu (Christopher Tate) (01/26/91)

Things are progressing fairly well in my screen-saver project:  I install
a jGNEFilter routine that checks for events and mouse movement, and blanks
the screen by opening my own GrafPort on top of it if the machine is idle
for more than a certain amount of time.

Unfortunately, I don't know how to keep other applications from writing
into the screen while it's blanked.  A couple of ideas have occurred to me:

1)  I could redirect the QuickDraw standard drawing procs into my own
    code, to intercept them.  I don't know if this will work at all, let
    alone under MultiFinder.

2)  I could simply refuse to let anything else execute while the screen is
    blank.

Number 2) sounds more feasible, but it prevents any sort of background
processing from occurring.  Has anyone out there solved this problem?
Anyone have good ideas on how to keep things such as TextEdit's flashing
of the insertion point (as in modal dialogs) from interrupting the
screen?

(By the way, a couple of people have asked me why I'm bothering to
write my own screen saver, rather than use an established product
such as Pyro! or AfterDark.  The answer is that this is a project for
the Penn State Center for Academic Computing.  We have been using
the freeware screen saver "FadeToBlack," but it does not work under
System 6.0.7.  Due to monetary constraints, we cannot use a commercial
or even shareware screen saver.  So, here I am trying to work it out
myself....)

When I finally get this thing running, I'll summarize to the net all
the tricks I had to use to get the thing to work.

-------
Christopher Tate                   | "Excuse me, is this your bag?"
                                   | "No."
cxt105@psuvm.psu.edu               | "Are you sure?  Do take your time."
{...}!psuvax1!psuvm.bitnet!cxt105  | "This is definitely *not* my bag."
cxt105@psuvm.bitnet                | "Just as we thought...."

hairston@henry.ece.cmu.edu (David Hairston) (01/27/91)

[CXT105@psuvm.psu.edu (Christopher Tate) writes:]
[] Things are progressing fairly well in my screen-saver project:  I install
[] a jGNEFilter routine that checks for events and mouse movement, and blanks
[] the screen by opening my own GrafPort on top of it if the machine is idle
[] for more than a certain amount of time.
[]
[] Unfortunately, I don't know how to keep other applications from writing
[] into the screen while it's blanked.  A couple of ideas have occurred to me:

the window manager (when used properly) prevents overlapped windows
from writing to the front window.  i think the trick here is to open
a window that covers the GrayRgn rectangle, include the menu bar region
into that windows visRgn and clipRgn and not worry about hidden windows.
when your window is on top you can draw what you want.  when you're done,
closing your window will prompt the window manager to update the visRgn's
of the previously hidden windows.

Tom Dowdy's Darkside of the Mac (comp.binaries.mac) is freeware and
extensible and includes example code as well ...

  -dave-  
hairston@henry.ece.cmu.edu