--- a/src/powersaving_mac.cpp 2025-06-09 19:27:12.000000000 +0800 +++ b/src/powersaving_mac.cpp 2026-01-08 09:12:30.000000000 +0800 @@ -19,8 +19,13 @@ #include "powersaving_mac.h" #include +#include #include +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 +#define IOPMAssertionCreateWithName IOPMAssertionCreate +#endif + PowerSaving::PowerSaving(QObject * parent) : QObject(parent) { @@ -36,7 +41,9 @@ CFStringRef assertion_type = kIOPMAssertionTypeNoDisplaySleep; IOReturn r = IOPMAssertionCreateWithName(assertion_type, kIOPMAssertionLevelOn, +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 CFSTR("Playing media content"), +#endif &assertion_id); if (r == kIOReturnSuccess) { qDebug() << "PowerSaving::inhibit: adding assertion_id:" << assertion_id;