From d679b977529b6f76274e46cfa9392a88d9a1a721 Mon Sep 17 00:00:00 2001 From: FischLu Date: Sun, 3 Nov 2024 01:15:01 +0100 Subject: [PATCH] the macos version need to be checked during runtime --- src/gui/osutils/macutils/AppKitImpl.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/osutils/macutils/AppKitImpl.mm b/src/gui/osutils/macutils/AppKitImpl.mm index 5092790d88..a71b19cc88 100644 --- a/src/gui/osutils/macutils/AppKitImpl.mm +++ b/src/gui/osutils/macutils/AppKitImpl.mm @@ -187,6 +187,7 @@ - (bool) enableAccessibility - (bool) enableScreenRecording { #if __clang_major__ >= 13 && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_VERSION_12_3 + if (@available(macOS 12.3, *)) { __block BOOL hasPermission = NO; dispatch_semaphore_t sema = dispatch_semaphore_create(0); @@ -210,6 +211,7 @@ - (bool) enableScreenRecording // Return the final result return hasPermission; + } #endif return YES; // Return YES for macOS versions that do not support ScreenCaptureKit }