Skip to content
CinderBlock to access Activity APIs added in OS X 10.9 to tie into App Nap
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Cinder-AppNap is a CinderBlock to access the Activity APIs introduced in OS X 10.9.

OS X 10.9 uses heuristics to improve system battery life, performance and responsiveness and governs the resources made available to applications and their behavior to achieve this. At times the system behavior isn't desirable and Cinder-AppNap can be used to hint an exceptional need. Doing so can obviously negatively affect the battery life, performance and responsiveness of the system as a whole, so one should be critical of its use and disciplined in minimizing its use to a narrow scope.

While the CinderBlock is (perhaps poorly) named Cinder-AppNap, an application can provide hints that affect other behaviors like timer coalescing and the application termination. Cinder-AppNap currently disables idle system sleep and sudden termination which is hopefully a fit for most Cinder application needs, but could certainly be made more flexible should the need arise.

NOTE - The exceptional need hint can be sent from Cinder, via AppBase::Settings::setPowerManagementEnabled() or AppBase::enablePowerManagement(); see PR #867 for more detail.


void VisionApp::setup() {
    Cinder::AppNap::PerformActivity("Preprocess images", [this](void) {
        auto handle = std::async([this](void) {

Long-running operations can use a more explicit form:

void CaptureApp::setup() {
    Cinder::AppNap::BeginActivity("Maintain camera control");

void CaptureApp::shutdown() {


System power assertions can be verified with the pmset command line tool:

$ pmset -g assertions
You can’t perform that action at this time.