Fix compiling on Snow Leopard.
This commit is contained in:
parent
0bfdbce64f
commit
7fc733fca1
@ -19,13 +19,22 @@
|
|||||||
|
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
|
#include "core/utilities.h"
|
||||||
|
|
||||||
|
// kIOPMAssertionTypePreventUserIdleDisplaySleep from Lion.
|
||||||
|
#define kLionDisplayAssertion CFSTR("PreventUserIdleDisplaySleep")
|
||||||
|
|
||||||
MacScreensaver::MacScreensaver()
|
MacScreensaver::MacScreensaver()
|
||||||
: assertion_id_(0) {
|
: assertion_id_(0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacScreensaver::Inhibit() {
|
void MacScreensaver::Inhibit() {
|
||||||
|
CFStringRef assertion_type = (Utilities::GetMacVersion() >= 7)
|
||||||
|
? kLionDisplayAssertion
|
||||||
|
: kIOPMAssertionTypeNoDisplaySleep;
|
||||||
|
|
||||||
IOPMAssertionCreateWithName(
|
IOPMAssertionCreateWithName(
|
||||||
kIOPMAssertionTypePreventUserIdleDisplaySleep,
|
assertion_type,
|
||||||
kIOPMAssertionLevelOn,
|
kIOPMAssertionLevelOn,
|
||||||
CFSTR("Showing full-screen Clementine visualisations"),
|
CFSTR("Showing full-screen Clementine visualisations"),
|
||||||
&assertion_id_);
|
&assertion_id_);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user