Priority When Hidden

I have an application that will have a window frequently hidden or in background.
There is a timer.

When “background” it seems to not respond the same as it would foreground. I’m sure this has something to do with optimizing what the OS thinks the user is working on, and to some extent de-prioritization is fine.

Is there some way to ensure that the timer still functions reliably in this state?

you may need to declare an activity to tell the OS, you are busy:


I suspected you’d have a solution. Thanks.

This is indeed the case. OSX may “app nap” your application if you don’t. Had that happen to me either when the desktop app is minimized or when its only window was completely covered by other applications. I’m now using that MBS class to start an activity when my timer starts, and release it when I no longer need the timer running.