UI: Inhibit sleep/screensavers while active
parent
d78d0072a0
commit
274841860b
|
@ -941,6 +941,8 @@ void OBSBasic::OBSInit()
|
|||
|
||||
connect(ui->preview, &OBSQTDisplay::DisplayCreated, addDisplay);
|
||||
|
||||
sleepInhibitor = os_inhibit_sleep_create("OBS Video/audio");
|
||||
os_inhibit_sleep_set_active(sleepInhibitor, true);
|
||||
show();
|
||||
}
|
||||
|
||||
|
@ -1193,6 +1195,9 @@ OBSBasic::~OBSBasic()
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
os_inhibit_sleep_set_active(sleepInhibitor, false);
|
||||
os_inhibit_sleep_destroy(sleepInhibitor);
|
||||
}
|
||||
|
||||
void OBSBasic::SaveProjectNow()
|
||||
|
|
|
@ -89,6 +89,7 @@ private:
|
|||
|
||||
QPointer<QTimer> cpuUsageTimer;
|
||||
os_cpu_usage_info_t *cpuUsageInfo = nullptr;
|
||||
os_inhibit_t *sleepInhibitor = nullptr;
|
||||
|
||||
OBSService service;
|
||||
std::unique_ptr<BasicOutputHandler> outputHandler;
|
||||
|
|
Loading…
Reference in New Issue