SYNERGY-988 - Normalize scrolling direction (#7044)

* SYNERGY-988 - Normalize scrolling direction on Mac

* SYNERGY-988 - Scroll direction check on Windows

* SYNERGY-988 - Add check for registry key presence

* SYNERGY-988 - Normalize scrolling directino on Linux

* SYNERGY-988 - Detach scroll direction check on Windows

* SYNERGY-988 - Update changelog

* SYNERGY-988 - Resolve code smells

* SYNERGY-988 - Normalize scroll direction for Linux servers

* SYNERGY-988 - Removed unnecessary INFO level logs

Co-authored-by: SerhiiGadzhilov <71632867+SerhiiGadzhilov@users.noreply.github.com>
This commit is contained in:
Igor Sikachyna
2021-06-30 15:25:11 +03:00
committed by GitHub
parent 16d9a3dce0
commit 89363240eb
12 changed files with 185 additions and 5 deletions

View File

@ -19,6 +19,10 @@
#include "arch/unix/ArchSystemUnix.h"
#include <sys/utsname.h>
#include <stdio.h>
#include <array>
#include <memory>
#include <string>
//
// ArchSystemUnix
@ -78,3 +82,21 @@ ArchSystemUnix::getLibsUsed(void) const
{
return "not implemented.\nuse lsof on shell";
}
std::string
ArchSystemUnix::runCommand(const std::string& cmd)
{
std::array<char, 128> buffer;
std::string result;
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd.c_str(), "r"), &pclose);
if (!pipe)
{
return "";
}
while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr)
{
result += buffer.data();
}
return result;
}