Yes, this is an every increasingly annoying bug. I filed a similar
issue (#9402554) and based on the duplicate bug # referenced, it
appears it has been around a while.

I've tried most of the solutions offered by developers before (from
AppleScripts to setting focus on the dock) and none have worked for
me. I then took a very inelegant approach to this:

Launch a new instance of same app (you could add a special arg to
indicate launch as foreground app).
Then quit the old agent.
In applicationWillFinishLaunching: if your arg is there,  call
TransformProcessType(). It seems that applicationWillFinishLaunching:
is early enough in the launch that the menubar will update properly
when you transform the process type.

If you needed to keep data, you could put it up on a private
NSPasteboard and grab it again.

This has been the most reliable way of converting an agent to a
foreground app that I've found. But, IMHO, it is also the ugliest
approach.

I really hope Apple just fixes this issue once and for all.

Mark

On Fri, May 27, 2011 at 11:01 AM, Jerry Krinock <je...@ieee.org> wrote:
> Thank you, Jim.  Unfortunately your workaround doesn't work in my app either.
>
> I presume it will work in a simple app.  I'm tired of poking, so I'll have to 
> do the usual drill of rebuilding a replica of my app from a simple app piece 
> by piece and see where it breaks :(
>
> _______________________________________________
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/unmarked%40gmail.com
>
> This email sent to unmar...@gmail.com
>



-- 
Mark Munz
unmarked software
http://www.unmarked.com/
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to