Re: Finder not responding to [NSRunningApplication activateWithOptions]
Re: Finder not responding to [NSRunningApplication activateWithOptions]
- Subject: Re: Finder not responding to [NSRunningApplication activateWithOptions]
- From: John Joyce <email@hidden>
- Date: Thu, 09 Apr 2015 01:37:58 +0900
> On Apr 8, 2015, at 11:38 PM, Ken Thomases <email@hidden <mailto:email@hidden>> wrote:
>
> On Apr 8, 2015, at 9:19 AM, Tomáš Znamenáček <email@hidden <mailto:email@hidden>> wrote:
>
>> I should have mentioned that Finder behaves unlike other apps in this
>> regard. If I do the same with any other app, the app is correctly focused,
>> stealing focus from whatever app was focused before. (And the menu bar on
>> the display “gets focus”, too. Gets opaque, anyway.)
>
> In the Finder, the desktop can be the main/key window. For example, you can cycle to it using Command-`.
>
> Regards,
> Ken
>
I NEVER noticed that before.
It’s weird because it IS a window, but it doesn’t order above others, so it isn’t totally obvious that the desktop has focus, and because its window level is so low, if you have multiple windows from other apps open, it’s extra not obvious.
Wow. This is a nice trick to know, but mostly not useful if you cannot see what you are selecting with the keyboard. Kind of scary actually to now realize this behaves this way. (it certainly explains curiously named items on my desktop over the years, and I have weird feeling it’s been like this for forever and a day…)
So sounds like the trick is the window ordering, but that’s hard to tell with the desktop.
As a workaround though
[[NSWorkspace sharedWorkspace] launchApplication:@"Finder.app"];
Seems to do what Tomas is asking for.
Even selecting desktop first, the launching an app with this as the only thing in applicationDidFinishLaunching: brings Finder to the front with the front most (non desktop) window selected.
_______________________________________________
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