From 0fa7834bfc90afbafae64bc36eb9139f1d2aaadf Mon Sep 17 00:00:00 2001 From: gxalpha Date: Sat, 18 Jun 2022 15:32:00 +0200 Subject: [PATCH] UI: Use libobs rosetta detection --- UI/obs-app.cpp | 2 +- UI/platform-osx.mm | 13 ------------- UI/platform.hpp | 1 - 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/UI/obs-app.cpp b/UI/obs-app.cpp index a3bc5dfb6..e84ae9e02 100644 --- a/UI/obs-app.cpp +++ b/UI/obs-app.cpp @@ -2173,7 +2173,7 @@ static int run_program(fstream &logFile, int argc, char *argv[]) } #ifdef __APPLE__ - bool rosettaTranslated = ProcessIsRosettaTranslated(); + bool rosettaTranslated = os_get_emulation_status(); blog(LOG_INFO, "Rosetta translation used: %s", rosettaTranslated ? "true" : "false"); #endif diff --git a/UI/platform-osx.mm b/UI/platform-osx.mm index bab4018b5..af66ab723 100644 --- a/UI/platform-osx.mm +++ b/UI/platform-osx.mm @@ -202,19 +202,6 @@ void EnableOSXDockIcon(bool enable) NSApplicationActivationPolicyProhibited]; } -bool ProcessIsRosettaTranslated() -{ -#ifdef __aarch64__ - return false; -#else - int ret = 0; - size_t size = sizeof(ret); - if (sysctlbyname("sysctl.proc_translated", &ret, &size, NULL, 0) == -1) - return false; - return ret == 1; -#endif -} - // Not implemented yet void TaskbarOverlayInit() {} void TaskbarOverlaySetStatus(TaskbarOverlayStatus) {} diff --git a/UI/platform.hpp b/UI/platform.hpp index 745273151..cef63d300 100644 --- a/UI/platform.hpp +++ b/UI/platform.hpp @@ -85,5 +85,4 @@ void EnableOSXDockIcon(bool enable); bool isInBundle(); void InstallNSApplicationSubclass(); void disableColorSpaceConversion(QWidget *window); -bool ProcessIsRosettaTranslated(); #endif