Make Current App Not have Focus - MacOS

I have an app that Displays a small timer window, When the timer window shows it minimizes the app’s main window, I need to to accept a restore when the Icon in thee doc is clicked, but if the focus is still on the app’s timer window it doesn’t restore unless I click on another app. Then it restores.

So if when the timer window opens, I can programmatically move focus to something else, like the desktop so that is the app icon is clicked in the doc it restores?

I hope this is clear.


I get the impression, but I may be wrong, that the small timer window is a floating window.
If so, have you tried testing with a document window?

As I understand, Richard’s problem has only to do with the fact the app is frontmost, regardless of the window shown in the app (no window shown at all would have the same effect).

You can’t send your app to the background without bringing another app to the front; however, as you can’t know which app was in front before, you can’t arbitrarily bring one to the front (that would confuse the user).
Instead, I think you have ways for your app to not become to front (activated) in the first place; however, I don’t know if it’s doable in Xojo, hence I didn’t answered.

If you use MBS Xojo Plugins and NSApplicationMBS class, you could do:


to hide your app.