Re: Watching for new windows
Re: Watching for new windows
- Subject: Re: Watching for new windows
- From: Bill Cheeseman <email@hidden>
- Date: Thu, 20 Nov 2003 16:09:20 -0500
on 2003-11-20 2:49 PM, Modesitt Software at email@hidden wrote:
>
I started this thread, and I seem to get the opposite of this bug. My
>
intent is to log the frontmost window of the current application. When
>
my app starts, it creates an observer for (almost) every process
>
running. When the user changes windows using the current application,
>
my app is notified. So far so good. However, when the user switches
>
to a Carbon application, my observer receives two identical
>
notifications. When the user switches to a Cocoa application, my
>
observer receives no notifications. So I get either two or zero
>
notifications when the user switches to a different app, but all I
>
really want is one!
Just to be sure I'm on the same page you're on: Your observers are observing
the root application element of each process, and they are being registered
for application-activated notifications, correct? That is how I interpreted
your description, but the behavior you are describing (2 notifications when
a Carbon application activates, and none when a Cocoa application activates)
is certainly contrary to what I have experienced over the last year and
more.
I'm pretty confident of my interpretation of the bug I'm talking about,
partly because my correspondence with the Apple engineer last November was
so specific, and partly because the workaround he suggested has worked
flawlessly for over a year now. In fact, I have a switch in my application
that lets me easily recompile without the workaround. Every time I do that
on a new release of the Mac OS, I experience the same buggy behavior, and
every time I switch it back, the buggy behavior is correctly worked around.
If you were registering for both activated and deactivated notifications,
you should of course see 2 notifications every time the user switches
applications -- 1 for deactivating the formerly frontmost application and 1
for activating the newly frontmost application. But because of the bug I
mentioned, you would actually see 2 deactivates and 1 activate when
switching from a Cocoa to a Carbon app, and 1 deactivate and 2 activates
when switching from a Carbon to a Cocoa app.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
accessibility-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/accessibility-dev
Do not post admin requests to the list. They will be ignored.