Commit 8f844d9a authored by Rob Jonson's avatar Rob Jonson Committed by Felix Paul Kühne

Use new function to declare user activity (from 10.7.3). This is the new...

Use new function to declare user activity (from 10.7.3). This is the new official way to wake the display, rather than simply preventing display sleep.
Signed-off-by: default avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 4cfd989f
......@@ -145,6 +145,7 @@ struct intf_sys_t
/* sleep management */
IOPMAssertionID systemSleepAssertionID;
IOPMAssertionID userActivityAssertionID;
VLCVoutWindowController *o_vout_controller;
}
......
......@@ -1407,6 +1407,20 @@ static VLCMain *_o_sharedMainInstance = nil;
if (p_input) {
int state = var_GetInteger(p_input, "state");
if (state == PLAYING_S) {
/* Declare user activity.
This wakes the display if it is off, and postpones display sleep according to the users system preferences
Available from 10.7.3
*/
if ([self activeVideoPlayback] && IOPMAssertionDeclareUserActivity)
{
CFStringRef reasonForActivity = CFStringCreateWithCString(kCFAllocatorDefault, _("VLC media playback"), kCFStringEncodingUTF8);
IOPMAssertionDeclareUserActivity(reasonForActivity,
kIOPMUserActiveLocal,
&userActivityAssertionID);
CFRelease(reasonForActivity);
}
/* prevent the system from sleeping */
if (systemSleepAssertionID > 0) {
msg_Dbg(VLCIntf, "releasing old sleep blocker (%i)" , systemSleepAssertionID);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment