From 835e22e334d54ec9986002fbd5a7f8481fe59f62 Mon Sep 17 00:00:00 2001 From: wupl Date: Mon, 17 Apr 2023 18:13:46 +0800 Subject: [PATCH] fix: wake up on mac when screen locked @shymega's note: from debauchee/barrier#1927, thank you @junbujianwpl. I'm creating PRs from Barrier's unmerged PRs for Input Leap. This is so we can a) let the community know that there is an active fork and b) take advantage of the code contributions that Barrier simply isn't accepting. This gives us the benefit of improved codebase and bug fixes, such as this one, which happens on Mac machines. --- src/lib/platform/OSXScreen.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/platform/OSXScreen.mm b/src/lib/platform/OSXScreen.mm index c8c74abdb..5c8cb80c5 100644 --- a/src/lib/platform/OSXScreen.mm +++ b/src/lib/platform/OSXScreen.mm @@ -811,6 +811,8 @@ IORegistryEntrySetCFProperty(entry, CFSTR("IORequestIdle"), kCFBooleanFalse); IOObjectRelease(entry); } + IOPMAssertionID assertionID; + IOPMAssertionDeclareUserActivity(CFSTR(""), kIOPMUserActiveLocal, &assertionID); avoidSupression(); }