UI: Only inhibit when active or if projector open

Having sleep or screensavers inhibited at all times was causing some
annoyances for people.  Sleep/screensavers are now only inhibited when
the program is active or when a projector is open.
This commit is contained in:
jp9000
2015-11-16 09:08:55 -08:00
parent 14bfa07168
commit 34bbc444eb
5 changed files with 60 additions and 14 deletions
+9 -1
View File
@@ -524,7 +524,15 @@ bool OBSApp::InitTheme()
OBSApp::OBSApp(int &argc, char **argv, profiler_name_store_t *store)
: QApplication(argc, argv),
profilerNameStore(store)
{}
{
sleepInhibitor = os_inhibit_sleep_create("OBS Video/audio");
}
OBSApp::~OBSApp()
{
os_inhibit_sleep_set_active(sleepInhibitor, false);
os_inhibit_sleep_destroy(sleepInhibitor);
}
static void move_basic_to_profiles(void)
{