home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!mdisea!jackb
- From: jackb@mdd.comm.mot.com (Jack Brindle)
- Subject: Re: The Forgetful Finder
- Message-ID: <1992Nov11.000631.7251@mdd.comm.mot.com>
- Sender: news@mdd.comm.mot.com
- Organization: Motorola, Mobile Data Division - Seattle, WA
- References: <Nov.9.12.14.27.1992.24843@math.rutgers.edu> <keith-091192124523@kip-16.taligent.com> <BxIM0r.IHC@unx.sas.com>
- Date: Wed, 11 Nov 1992 00:06:31 GMT
- Lines: 46
-
- In article <BxIM0r.IHC@unx.sas.com> Michael Hecht <Michael_Hecht@mac.sas.com> writes:
- >This sounds very similar to one of my pet peeves. It seems that there's a
- >bug in the Mac OS in that if an application creates a new window when
- >it's not the foreground app, the window appears enabled. Its title bar
- >has the vertical lines in it, etc. Nuntius is a prime example. This
- >becomes a problem when I use the title bar as a visual cue to tell me
- >what the front-most application is. I may end up typing text or command
- >keys only to discover that the text isn't going where I intended, or the
- >command keys are doing things I don't want! Is this the behavior you're
- >describing?
- >
- >I thought of a very kludgy way to get around the bug. It involves making
- >an invisible "spare" window, which is normally last in the window list.
- >When an application is suspended, it brings this inviso window to the
- >front. Notice that this also generates a deactivate event for the
- >frontmost window, so the app won't have to simulate that as well. When
- >the app opens any new windows, it now opens them *behind* the inviso
- >window, causing them to appear deactivated. When the app is resumed, it
- >moves the inviso window to the rear, causing the frontmost window to
- >receive an activate event.
- >
- >You could maintain a static WindowPtr variable named "behindWindow" that
- >points to the inviso window when you're in the background, and contains (
- >WindowPtr )-1 when you're in the foreground. Then you just need to pass
- >this variable as the "behind" value to the NewWindow calls.
- >
- >Of course, fixing it in the Window Manager is the better solution, Apple!
-
- Come now. The Window manager has no concept of foreground or background.
- That is more the domain of the process manager. The Window manager does
- not unhilite a window when the application is moved to the background,
- the app itself takes care of this in response to various events. I would
- suggest a different approach to creating a window. Something of the sort:
- Create the window as invisible. Check the foreground/background status (you
- _were_ catching these events, right?). If the state indicates background,
- (or non frontmost app) then unhilite the window. Finally, make the window
- visible. The proper update events will be generated, causing the window
- to be drawn the way you want it. I haven't tried this (yet), so feel free
- to try to show why it won't work. The real point is, don't blame the OS
- for a deficiency in some developer's code.
-
- --
- ==========================================================
- Jack Brindle
- ham radio: wa4fib
- internet: jackb@mdd.comm.mot.com
-