From 3e5626e48ac3e9bc7a8d699ada9713e01ccc6515 Mon Sep 17 00:00:00 2001 From: Igor Sikachyna Date: Mon, 7 Jun 2021 13:30:39 +0300 Subject: [PATCH] SYNERGY-1017 - Simplify the check for secure input --- src/gui/src/OSXHelpers.mm | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/gui/src/OSXHelpers.mm b/src/gui/src/OSXHelpers.mm index e9bd75a7d..2d43aa2a2 100644 --- a/src/gui/src/OSXHelpers.mm +++ b/src/gui/src/OSXHelpers.mm @@ -22,21 +22,13 @@ #import #import #import +#import + bool isOSXSecureInputEnabled() { - std::array buffer; - std::string result; - std::unique_ptr pipe(popen("ioreg -l -w 0 | grep kCGSSessionSecureInputPID", "r"), pclose); - if (!pipe) { - return false; - } - while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr) - { - result += buffer.data(); - } - return result.length() > 0; + return IsSecureEventInputEnabled(); } bool