Re: TransformProcessType() still doesn't show menu (Bug ID# 5905139)
Re: TransformProcessType() still doesn't show menu (Bug ID# 5905139)
- Subject: Re: TransformProcessType() still doesn't show menu (Bug ID# 5905139)
- From: Mark Munz <email@hidden>
- Date: Fri, 27 May 2011 12:30:24 -0700
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 <email@hidden> 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 (email@hidden)
>
> 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:
>
> This email sent to email@hidden
>
--
Mark Munz
unmarked software
http://www.unmarked.com/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden