incorporating sonar's major

This commit is contained in:
Ignacio Rodriguez 2020-11-05 19:20:45 +07:00
parent b9d3ce8aa0
commit 23037d7932
3 changed files with 24 additions and 28 deletions

View file

@ -61,7 +61,7 @@ ArchFileUnix::getUserDirectory()
std::string dir; std::string dir;
#if HAVE_GETPWUID_R #if HAVE_GETPWUID_R
struct passwd pwent; struct passwd pwent;
struct passwd* pwentp; struct passwd* pwentp {};
#if defined(_SC_GETPW_R_SIZE_MAX) #if defined(_SC_GETPW_R_SIZE_MAX)
long size = sysconf(_SC_GETPW_R_SIZE_MAX); long size = sysconf(_SC_GETPW_R_SIZE_MAX);
if (size == -1) { if (size == -1) {

View file

@ -848,12 +848,12 @@ void
XWindowsScreen::fakeMouseRelativeMove(SInt32 dx, SInt32 dy) const XWindowsScreen::fakeMouseRelativeMove(SInt32 dx, SInt32 dy) const
{ {
// FIXME -- ignore xinerama for now // FIXME -- ignore xinerama for now
if (false && m_xinerama && m_xtestIsXineramaUnaware) { // if (false && m_xinerama && m_xtestIsXineramaUnaware) {
// XWarpPointer(m_display, None, m_root, 0, 0, 0, 0, x, y); // XWarpPointer(m_display, None, m_root, 0, 0, 0, 0, x, y);
} // }
else { // else {
XTestFakeRelativeMotionEvent(m_display, dx, dy, CurrentTime); XTestFakeRelativeMotionEvent(m_display, dx, dy, CurrentTime);
} // }
XFlush(m_display); XFlush(m_display);
} }

View file

@ -174,28 +174,24 @@ ArgParser::parsePlatformArg(lib::synergy::ArgsBase& argsBase, const int& argc, c
bool bool
ArgParser::parseToolArgs(ToolArgs& args, int argc, const char* const* argv) ArgParser::parseToolArgs(ToolArgs& args, int argc, const char* const* argv)
{ {
for (int i = 1; i < argc; ++i) { // We support exactly one argument at a fix position
if (isArg(i, argc, argv, NULL, "--get-active-desktop", 0)) { static const int only_index {1};
args.m_printActiveDesktopName = true; if (isArg(only_index, argc, argv, NULL, "--get-active-desktop", 0)) {
return true; args.m_printActiveDesktopName = true;
} return true;
else if (isArg(i, argc, argv, NULL, "--get-installed-dir", 0)) { }
args.m_getInstalledDir = true; else if (isArg(only_index, argc, argv, NULL, "--get-installed-dir", 0)) {
return true; args.m_getInstalledDir = true;
} return true;
else if (isArg(i, argc, argv, NULL, "--get-profile-dir", 0)) { }
args.m_getProfileDir = true; else if (isArg(only_index, argc, argv, NULL, "--get-profile-dir", 0)) {
return true; args.m_getProfileDir = true;
} return true;
else if (isArg(i, argc, argv, NULL, "--get-arch", 0)) { }
args.m_getArch = true; else if (isArg(only_index, argc, argv, NULL, "--get-arch", 0)) {
return true; args.m_getArch = true;
} return true;
else {
return false;
}
} }
return false; return false;
} }