1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-02-01 11:56:45 +01:00

Fix compiling on Snow Leopard.

This commit is contained in:
John Maguire 2012-10-29 12:47:03 +00:00
parent 0bfdbce64f
commit 7fc733fca1

View File

@ -19,13 +19,22 @@
#include <QtDebug>
#include "core/utilities.h"
// kIOPMAssertionTypePreventUserIdleDisplaySleep from Lion.
#define kLionDisplayAssertion CFSTR("PreventUserIdleDisplaySleep")
MacScreensaver::MacScreensaver()
: assertion_id_(0) {
}
void MacScreensaver::Inhibit() {
CFStringRef assertion_type = (Utilities::GetMacVersion() >= 7)
? kLionDisplayAssertion
: kIOPMAssertionTypeNoDisplaySleep;
IOPMAssertionCreateWithName(
kIOPMAssertionTypePreventUserIdleDisplaySleep,
assertion_type,
kIOPMAssertionLevelOn,
CFSTR("Showing full-screen Clementine visualisations"),
&assertion_id_);