Crates.io | macos-app-nap |
lib.rs | macos-app-nap |
version | 0.0.1 |
source | src |
created_at | 2021-01-14 22:49:01.45022 |
updated_at | 2021-01-14 22:49:01.45022 |
description | Control App Nap on macOS systems |
homepage | |
repository | https://github.com/next-slide-please/macos-app-nap |
max_upload_size | |
id | 342142 |
size | 6,883 |
On macOS, AppNap is a mechanism of reducing the energy consumption of apps by suspending them if the user is not interacting with an app.
As a concrete example, when running the druid timer example with some debug output added around the timer event, you'll notice that the output slows down significantly after about a minute if the application windows is in the background an completely invisible / covered by other windows.
To prevent this, e.g. if you're doing processing in the background and are relying on the timer, you can use this crate. Currently it only supports disabling App Nap entirely for the applications. More granular control is likely possible and desirable, and may be added in the future (pull requests welcome!).
Fairly simple at the moment:
fn main() {
macos_app_nap::prevent();
}
MIT. See LICENSE.md for details.