NSApplication resets the front most application status: hide v. Deactivate

I have an application that should become the largest application after the timer expires and resigns before the highest status when the timer is started by pressing a button, for example.

  • click "start timer" -> application resigns to most applications
  • timer expires -> application becomes front most applications

I deliberately rephrased the situation somewhat, because playing with an active status of sharedApplication does not do what I want.

I become the front most applications by running [[NSApplication sharedApplication] activateIgnoringOtherApps: YES] and this works fine.

Doing the opposite seems impossible !?

  • [[NSApplication sharedApplication] deactivate] should not be called directly, but, more importantly, it does not transfer the next application to the "command order". The application just sits there with its menu bar, but it is no longer "active".

  • [[NSApplication sharedApplication] hide: self] resigns from the active state and adds the next application to the "Command Order" in the foreground, but also hides all application windows.

I need to somehow bring the following application in the order of command entry to the beginning WITHOUT hiding all my windows.

Is there a good way to do this?

The solution should be 10.5 compatible with Leopard and 10.6.

I have had a solution since about 1996, but it includes Carbon APIs, and I would prefer to do it Cocoa, or at least the Foundation way.

Any help would be greatly appreciated.

+4
source share
1 answer

Did you try to hide and then unhideWithoutActivation?

+3
source

All Articles