Re: Watching for new windows
Re: Watching for new windows
- Subject: Re: Watching for new windows
- From: Bill Cheeseman <email@hidden>
- Date: Wed, 19 Nov 2003 13:56:49 -0500
on 2003-11-19 1:20 PM, Eric Schlegel at email@hidden wrote:
>
On Nov 19, 2003, at 3:37 AM, Bill Cheeseman wrote:
>
>
> on 2003-11-18 7:03 PM, Modesitt Software at email@hidden
>
> wrote:
>
>
>
>> When switching to some
>
>> applications, such as Codewarrior, my callback function gets called
>
>> twice.
>
>
>
> Your diagnosis is correct (Carbon vs. Cocoa target). It is a known bug
>
> in
>
> Carbon or in the Accessibility API that has been there from the
>
> beginning.
>
> It only happens with the activated/deactivated and hidden/shown pairs.
>
>
It may be well-known to you, but I couldn't find any Carbon
>
accessibilty bugs with "window" in the title that seemed relevant. Did
>
you or someone else file a bug about this?
I had extensive discussions with Mike Engber about the bug and my
workaround, over a year ago. In fact, it was Mike who suggested the
workaround.
I just went back into my archives and see that I reported it to Mike in
November 2002. On Nov 19, 2002, his replies stated that he was able to
reproduce it, and that he had filed a bug on it. He didn't mention the bug
number. (You wouldn't find it under "window"; the following details may help
you find it.)
His remarks suggested that the extra notification was coming from Carbon,
but, if I understood him correctly, that the duplication only happened when
an application element in a Cocoa application was targeted. (It seems like
this is the opposite from what the person who started this thread reported,
but I'm not sure I understood exactly how he encountered the duplicate
notifications.)
Specifically, Mike Engber told me, "What going on is Cocoa is emitting
notifications for these events and so is Carbon - oblivious to the fact it's
being used in a Cocoa app and should keep quiet." He speculated that the
Carbon engineers, who implemented accessibility after it was done in Cocoa,
might have put some test code in for this situation and neglected to remove
it when Jaguar shipped.
He also said, "For purposes of the double notification bug were talking
about notifications that both Carbon & Cocoa would be emitting for the
same event - which, so far, seem to be limited to changes in the state
of the application (activate, deactivate, hide, show)."
I'm not sure I understood Mike's explanation fully. So, just to give you
more context, I'll tell you that I was encountering the duplicate
notifications in a Cocoa application (my PreFab UI Browser application),
when a user registered a target application to receive the
application-activated event. The actual registration takes place in a Cocoa
framework I wrote to wrap the Accessibility API. The callback function that
the notification triggers is also in the framework. The framework's callback
function uses NSInvoke to call a callback method in the UI Browser
application itself. I set it up this way so the framework could be used by
anybody, as long as they know the format to use for their Cocoa callback
method. (I haven't released the framework publically, but I intend to.)
The bug was present in prerelease and final versions of Jaguar, and
prerelease and final versions of Panther. All of the other major
Accessibility-related bugs I'm aware of in Jaguar have been fixed in
Panther.
--
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.