Frame: Use kIOPMAssertionTypePreventUserIdleDisplaySleep to inhibit screensaver on macOS

This commit is contained in:
MerryMage 2017-04-09 22:11:55 +01:00
parent c9b2c29ead
commit 4537969822

View File

@ -714,8 +714,9 @@ void CFrame::InhibitScreensaver()
if (SConfig::GetInstance().bDisableScreenSaver)
{
CFStringRef reason_for_activity = CFSTR("Emulation Running");
if (IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn,
reason_for_activity, &m_power_assertion) != kIOReturnSuccess)
if (IOPMAssertionCreateWithName(kIOPMAssertionTypePreventUserIdleDisplaySleep,
kIOPMAssertionLevelOn, reason_for_activity,
&m_power_assertion) != kIOReturnSuccess)
{
m_power_assertion = kIOPMNullAssertionID;
}