Re: activateIgnoringOtherApps
Re: activateIgnoringOtherApps
- Subject: Re: activateIgnoringOtherApps
- From: Chris Idou <email@hidden>
- Date: Sun, 31 Aug 2008 17:28:26 -0700 (PDT)
It looks like if the window I want to popup has NSBorderlessWindowMask set, then this API pops up TWO windows, both the one I really want, and the last active. On the other hand if it has a title, then it works as expected.
Any thoughts?
BTW, I'm not popping it up uninitiated, it's in response to a hotkey.
--- On Sun, 8/31/08, Ken Thomases <email@hidden> wrote:
> From: Ken Thomases <email@hidden>
> Subject: Re: activateIgnoringOtherApps
> To: email@hidden
> Cc: email@hidden
> Date: Sunday, August 31, 2008, 2:05 PM
> On Aug 31, 2008, at 8:48 AM, Chris Idou wrote:
>
> > I want to pop up a window in response to a hot key. So
> I'm creating
> > a window, setting it makeKeyAndOrderFront, and I'm
> calling [NSApp
> > activateIgnoringOtherApps] so that it gets focus.
> >
> > The thing is, activateIgnoringOtherApps seems to bring
> ALL my app's
> > windows in front of other windows (my app has other
> windows),
> > whereas all I want is to pop up my new window in front
> of the
> > currently active application without affecting the
> order of my app's
> > other windows, and leaving the previously active app
> to be second to
> > top.
> >
> > Has anyone got any idea how to achieve that?
>
> You can use SetFrontProcessWithOptions with
> kSetFrontProcessFrontWindowOnly.
>
> On the other hand, you should generally avoid bringing your
>
> application to the front except in response to user
> action/request.
> Ideally, the order of applications and windows is for the
> user to
> decide.
>
> If you need the user's attention, you can use NSAlert
> or -
> [NSApplication requestUserAttention:]. (I believe the
> former uses the
> latter.)
>
> Cheers,
> Ken
_______________________________________________
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