From f00f60a8fe7930227fbcd5a84c71c0fd56acf202 Mon Sep 17 00:00:00 2001 From: Robby Stahl Date: Thu, 10 Sep 2015 14:04:01 -0700 Subject: [PATCH 01/53] Update mac directions to not require a root user I updated the directions such that a clear installation path is provided that does not require the direct use of root. --- doc/MacReadme.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/MacReadme.txt b/doc/MacReadme.txt index da2930505..f62762e5a 100755 --- a/doc/MacReadme.txt +++ b/doc/MacReadme.txt @@ -5,10 +5,10 @@ To install on Mac OS X with the .zip distribution (first seen in 1.3.6) you must 1. Extract the zip file to any location (usually double click will do this) 2. Open Terminal, and cd to the extracted directory (e.g. /Users/my-name/Downloads/extracted-dir/) - 3. Change to super user (use the su command) - 4. Copy the binaries to /usr/bin using: cp synergy* /usr/bin + 3. Copy the binaries to /usr/bin using: sudo cp synergy* /usr/bin + 4. Correct the permissions and ownership: sudo chown root:wheel /usr/bin/synergy*; sudo chmod 555 /usr/bin/synergy* -How to enable the root user in Mac OS X: +Alternatively, you can copy the binaries as root. How to enable the root user in Mac OS X: http://support.apple.com/en-us/ht1528 Once the binaries have been copied to /usr/bin, you should follow the configuration guide: From 5a03ece50b4eb7cb0b8f7146a4052df878ca530a Mon Sep 17 00:00:00 2001 From: j2gl Date: Fri, 20 Nov 2015 01:35:23 -0600 Subject: [PATCH 02/53] Update MacOS warning --- src/gui/src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/src/main.cpp b/src/gui/src/main.cpp index 70816276b..b24bc5a19 100644 --- a/src/gui/src/main.cpp +++ b/src/gui/src/main.cpp @@ -156,7 +156,8 @@ bool checkMacAssistiveDevices() QMessageBox::information( NULL, "Synergy", "Please enable access to assistive devices " - "(System Preferences), then re-open Synergy."); + "System Preferences -> Security & Privacy -> " + "Privacy -> Accessibility, then re-open Synergy."); } return result; From 17961501f640d8af9b36903ae6d64e3f949a4269 Mon Sep 17 00:00:00 2001 From: Josh Harris Date: Tue, 18 Oct 2016 15:26:56 +0100 Subject: [PATCH 03/53] Update ISSUE_TEMPLATE.md Moved the 'Server' and 'Client' fields around --- .github/ISSUE_TEMPLATE.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index fa15485af..590f59a59 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,8 +1,7 @@ ### Operating Systems ### -Client: Applesoft Windy OS 10 - Server: microOS Tiara +Client: Applesoft Windy OS 10 **READ ME, DELETE ME**: On Windows, hold the Windows key and press 'r', type 'winver' and hit return to get your OS version. On Mac, hit the Apple menu (top left of the screen) and check 'About this Mac'. Linux users... you know what you're using ;) From 6b0cd355276eb754edce8906ee029af81393fc36 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Wed, 26 Oct 2016 08:10:09 -0700 Subject: [PATCH 04/53] #5186 Update registry keys to enable Windows 7 compatibility and disable DPI scaling --- src/setup/win32/Product.wxs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/setup/win32/Product.wxs b/src/setup/win32/Product.wxs index 03a309e81..cd794d172 100644 --- a/src/setup/win32/Product.wxs +++ b/src/setup/win32/Product.wxs @@ -28,8 +28,19 @@ + + + + + + + + + From 640262dfff6fad74ab40f4c8aa7d3ed8debb104a Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Wed, 26 Oct 2016 08:43:55 -0700 Subject: [PATCH 05/53] #5186 Only add DPI related registry key on Windows 8 or above --- src/setup/win32/Product.wxs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/setup/win32/Product.wxs b/src/setup/win32/Product.wxs index cd794d172..20de813af 100644 --- a/src/setup/win32/Product.wxs +++ b/src/setup/win32/Product.wxs @@ -38,6 +38,10 @@ Action="createAndRemoveOnUninstall"> + + + = 602)]]> + From c62c4d503dbbc2fedb4a9f247274684b2a1cfae4 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Fri, 28 Oct 2016 03:14:44 -0700 Subject: [PATCH 06/53] #5186 Remove dpiaware manifest --- res/dpiaware.manifest | 15 --------------- src/cmd/synergyc/CMakeLists.txt | 9 --------- src/cmd/synergyd/CMakeLists.txt | 9 --------- src/cmd/synergys/CMakeLists.txt | 9 --------- 4 files changed, 42 deletions(-) delete mode 100644 res/dpiaware.manifest diff --git a/res/dpiaware.manifest b/res/dpiaware.manifest deleted file mode 100644 index 743e3369b..000000000 --- a/res/dpiaware.manifest +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - true - - - - diff --git a/src/cmd/synergyc/CMakeLists.txt b/src/cmd/synergyc/CMakeLists.txt index 653cf374f..22bbe2573 100644 --- a/src/cmd/synergyc/CMakeLists.txt +++ b/src/cmd/synergyc/CMakeLists.txt @@ -60,15 +60,6 @@ add_executable(synergyc ${sources}) target_link_libraries(synergyc arch base client common io mt net ipc platform server synergy ${libs} ${OPENSSL_LIBS}) -if (WIN32) - ADD_CUSTOM_COMMAND( - TARGET synergyc - POST_BUILD - COMMAND "mt.exe" -manifest \"${CMAKE_SOURCE_DIR}\\res\\dpiaware.manifest\" -inputresource:\"$\"\;\#1 -outputresource:\"$\"\;\#1 - COMMENT "Adding display aware manifest..." - ) -endif() - if (CONF_CPACK) install(TARGETS synergyc diff --git a/src/cmd/synergyd/CMakeLists.txt b/src/cmd/synergyd/CMakeLists.txt index c8b578a90..a63bee676 100644 --- a/src/cmd/synergyd/CMakeLists.txt +++ b/src/cmd/synergyd/CMakeLists.txt @@ -37,15 +37,6 @@ endif() target_link_libraries(synergyd arch base common io ipc mt net platform synergy shared ${libs} ${OPENSSL_LIBS}) -if (WIN32) - ADD_CUSTOM_COMMAND( - TARGET synergyd - POST_BUILD - COMMAND "mt.exe" -manifest \"${CMAKE_SOURCE_DIR}\\res\\dpiaware.manifest\" -inputresource:\"$\"\;\#1 -outputresource:\"$\"\;\#1 - COMMENT "Adding display aware manifest..." - ) -endif() - if (CONF_CPACK) install(TARGETS synergyd diff --git a/src/cmd/synergys/CMakeLists.txt b/src/cmd/synergys/CMakeLists.txt index 023574b16..2474bcc67 100644 --- a/src/cmd/synergys/CMakeLists.txt +++ b/src/cmd/synergys/CMakeLists.txt @@ -60,15 +60,6 @@ add_executable(synergys ${sources}) target_link_libraries(synergys arch base client common io mt net ipc platform server synergy ${libs} ${OPENSSL_LIBS}) -if (WIN32) - ADD_CUSTOM_COMMAND( - TARGET synergys - POST_BUILD - COMMAND "mt.exe" -manifest \"${CMAKE_SOURCE_DIR}\\res\\dpiaware.manifest\" -inputresource:\"$\"\;\#1 -outputresource:\"$\"\;\#1 - COMMENT "Adding display aware manifest..." - ) -endif() - if (CONF_CPACK) install(TARGETS synergys From cf397a0d6f4cce4d8527730f849208453a22a97d Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Fri, 28 Oct 2016 04:50:06 -0700 Subject: [PATCH 07/53] #5186 Remove Dpi calculation code --- src/gui/src/MainWindow.cpp | 19 -------- src/lib/platform/MSWindowsScreen.cpp | 56 ++++++--------------- src/lib/server/Server.cpp | 9 ---- src/lib/synergy/ArgParser.cpp | 13 ----- src/lib/synergy/DpiHelper.cpp | 53 -------------------- src/lib/synergy/DpiHelper.h | 38 --------------- src/test/unittests/synergy/DpiHelperTests.cpp | 70 --------------------------- 7 files changed, 14 insertions(+), 244 deletions(-) delete mode 100644 src/lib/synergy/DpiHelper.cpp delete mode 100644 src/lib/synergy/DpiHelper.h delete mode 100644 src/test/unittests/synergy/DpiHelperTests.cpp diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index a431d27ea..eb37894a4 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -800,25 +800,6 @@ bool MainWindow::serverArgs(QStringList& args, QString& app) args << "--serial-key" << appConfig().serialKey(); } -#if defined(Q_OS_WIN) - // pass in physical resolution and primary screen center - // TODO: get this information in the core binary even when - // high DPI is used - int height = QApplication::desktop()->height(); - int width = QApplication::desktop()->width(); - - QRect rec = QApplication::desktop()->screenGeometry(); - int heightCenter = rec.height() / 2; - int widthCenter = rec.width() / 2; - - appendLogDebug(tr("screen resolution: %1 %2 primary screen center: %3 %4") - .arg(width).arg(height).arg(widthCenter).arg(heightCenter)); - - args << "--res-w" << QString::number(width); - args << "--res-h" << QString::number(height); - args << "--prm-wc" << QString::number(widthCenter); - args << "--prm-hc" << QString::number(heightCenter); - #endif return true; } diff --git a/src/lib/platform/MSWindowsScreen.cpp b/src/lib/platform/MSWindowsScreen.cpp index 74abfcd75..1ab3adf08 100644 --- a/src/lib/platform/MSWindowsScreen.cpp +++ b/src/lib/platform/MSWindowsScreen.cpp @@ -31,7 +31,6 @@ #include "synergy/App.h" #include "synergy/ArgsBase.h" #include "synergy/ClientApp.h" -#include "synergy/DpiHelper.h" #include "mt/Lock.h" #include "mt/Thread.h" #include "arch/win32/ArchMiscWindows.h" @@ -146,10 +145,6 @@ MSWindowsScreen::MSWindowsScreen( stopOnDeskSwitch); m_keyState = new MSWindowsKeyState(m_desks, getEventTarget(), m_events); - DpiHelper::calculateDpi( - GetSystemMetrics(SM_CXVIRTUALSCREEN), - GetSystemMetrics(SM_CYVIRTUALSCREEN)); - updateScreenShape(); m_class = createWindowClass(); m_window = createWindow(m_class, "Synergy"); @@ -348,8 +343,7 @@ MSWindowsScreen::leave() // warp to center LOG((CLOG_DEBUG1 "warping cursor to center: %+d, %+d", m_xCenter, m_yCenter)); - float dpi = DpiHelper::getDpi(); - warpCursor(m_xCenter / dpi, m_yCenter / dpi); + warpCursor(m_xCenter, m_yCenter); // disable special key sequences on win95 family enableSpecialKeys(false); @@ -1369,20 +1363,10 @@ MSWindowsScreen::onMouseButton(WPARAM wParam, LPARAM lParam) bool MSWindowsScreen::onMouseMove(SInt32 mx, SInt32 my) { - SInt32 originalMX = mx; - SInt32 originalMY = my; - float scaledMX = (float)mx; - float scaledMY = (float)my; - - if (DpiHelper::s_dpiScaled) { - scaledMX /= DpiHelper::getDpi(); - scaledMY /= DpiHelper::getDpi(); - } - // compute motion delta (relative to the last known // mouse position) - float x = scaledMX - m_xCursor; - float y = scaledMY - m_yCursor; + float x = (float)mx - m_xCursor; + float y = (float)my - m_yCursor; LOG((CLOG_DEBUG3 "mouse move - motion delta: %+d=(%+d - %+d),%+d=(%+d - %+d)", @@ -1395,14 +1379,14 @@ MSWindowsScreen::onMouseMove(SInt32 mx, SInt32 my) } // save position to compute delta of next motion - saveMousePosition((SInt32)scaledMX, (SInt32)scaledMY); + saveMousePosition(mx, my); if (m_isOnScreen) { // motion on primary screen sendEvent( m_events->forIPrimaryScreen().motionOnPrimary(), - MotionInfo::alloc(originalMX, originalMY)); + MotionInfo::alloc(m_xCursor, m_yCursor)); if (m_buttons[kButtonLeft] == true && m_draggingStarted == false) { m_draggingStarted = true; @@ -1415,8 +1399,7 @@ MSWindowsScreen::onMouseMove(SInt32 mx, SInt32 my) // will always try to return to the original entry point on the // secondary screen. LOG((CLOG_DEBUG5 "warping server cursor to center: %+d,%+d", m_xCenter, m_yCenter)); - float dpi = DpiHelper::getDpi(); - warpCursorNoFlush(m_xCenter / dpi, m_yCenter / dpi); + warpCursorNoFlush(m_xCenter, m_yCenter); // examine the motion. if it's about the distance // from the center of the screen to an edge then @@ -1424,10 +1407,10 @@ MSWindowsScreen::onMouseMove(SInt32 mx, SInt32 my) // ignore (see warpCursorNoFlush() for a further // description). static SInt32 bogusZoneSize = 10; - if (-x + bogusZoneSize > (m_xCenter - m_x) / dpi || - x + bogusZoneSize > (m_x + m_w - m_xCenter) / dpi || - -y + bogusZoneSize > (m_yCenter - m_y) / dpi || - y + bogusZoneSize > (m_y + m_h - m_yCenter) / dpi) { + if (-x + bogusZoneSize > m_xCenter - m_x || + x + bogusZoneSize > m_x + m_w - m_xCenter || + -y + bogusZoneSize > m_yCenter - m_y || + y + bogusZoneSize > m_y + m_h - m_yCenter) { LOG((CLOG_DEBUG "dropped bogus delta motion: %+d,%+d", x, y)); } @@ -1623,22 +1606,11 @@ void MSWindowsScreen::updateScreenShape() { // get shape and center - if (DpiHelper::s_dpiScaled) { - // use the original resolution size for width and height - m_w = (SInt32)DpiHelper::s_resolutionWidth; - m_h = (SInt32)DpiHelper::s_resolutionHeight; + m_w = GetSystemMetrics(SM_CXVIRTUALSCREEN); + m_h = GetSystemMetrics(SM_CYVIRTUALSCREEN); - // calculate center position according to the original size - m_xCenter = (SInt32)DpiHelper::s_primaryWidthCenter; - m_yCenter = (SInt32)DpiHelper::s_primaryHeightCenter; - } - else { - m_w = GetSystemMetrics(SM_CXVIRTUALSCREEN); - m_h = GetSystemMetrics(SM_CYVIRTUALSCREEN); - - m_xCenter = GetSystemMetrics(SM_CXSCREEN) >> 1; - m_yCenter = GetSystemMetrics(SM_CYSCREEN) >> 1; - } + m_xCenter = GetSystemMetrics(SM_CXSCREEN) >> 1; + m_yCenter = GetSystemMetrics(SM_CYSCREEN) >> 1; // get position m_x = GetSystemMetrics(SM_XVIRTUALSCREEN); diff --git a/src/lib/server/Server.cpp b/src/lib/server/Server.cpp index ec730bcd4..c980d03b3 100644 --- a/src/lib/server/Server.cpp +++ b/src/lib/server/Server.cpp @@ -33,7 +33,6 @@ #include "synergy/KeyState.h" #include "synergy/Screen.h" #include "synergy/PacketStreamFilter.h" -#include "synergy/DpiHelper.h" #include "net/TCPSocket.h" #include "net/IDataSocket.h" #include "net/IListenSocket.h" @@ -2004,14 +2003,6 @@ Server::onMouseMoveSecondary(SInt32 dx, SInt32 dy) SInt32 newX = m_x; SInt32 newY = m_y; - if (DpiHelper::s_dpiScaled) { - // only scale if it's going back to server - if (newScreen->isPrimary()) { - newX = (SInt32)(newX / DpiHelper::getDpi()); - newY = (SInt32)(newY / DpiHelper::getDpi()); - } - } - // switch screens switchScreen(newScreen, newX, newY, false); } diff --git a/src/lib/synergy/ArgParser.cpp b/src/lib/synergy/ArgParser.cpp index 1af32843b..a21cf9501 100644 --- a/src/lib/synergy/ArgParser.cpp +++ b/src/lib/synergy/ArgParser.cpp @@ -23,7 +23,6 @@ #include "synergy/ClientArgs.h" #include "synergy/ToolArgs.h" #include "synergy/ArgsBase.h" -#include "synergy/DpiHelper.h" #include "base/Log.h" #include "base/String.h" @@ -58,18 +57,6 @@ ArgParser::parseServerArgs(ServerArgs& args, int argc, const char* const* argv) // save configuration file path args.m_configFile = argv[++i]; } - else if (isArg(i, argc, argv, "", "--res-w", 1)) { - DpiHelper::s_resolutionWidth = synergy::string::stringToSizeType(argv[++i]); - } - else if (isArg(i, argc, argv, "", "--res-h", 1)) { - DpiHelper::s_resolutionHeight = synergy::string::stringToSizeType(argv[++i]); - } - else if (isArg(i, argc, argv, "", "--prm-wc", 1)) { - DpiHelper::s_primaryWidthCenter = synergy::string::stringToSizeType(argv[++i]); - } - else if (isArg(i, argc, argv, "", "--prm-hc", 1)) { - DpiHelper::s_primaryHeightCenter = synergy::string::stringToSizeType(argv[++i]); - } else if (isArg(i, argc, argv, "", "--serial-key", 1)) { args.m_serial = SerialKey(argv[++i]); } diff --git a/src/lib/synergy/DpiHelper.cpp b/src/lib/synergy/DpiHelper.cpp deleted file mode 100644 index 2f2ffcb70..000000000 --- a/src/lib/synergy/DpiHelper.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * synergy -- mouse and keyboard sharing utility - * Copyright (C) 2015 Synergy Seamless Inc. - * - * This package is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * found in the file LICENSE that should have accompanied this file. - * - * This package is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "synergy/DpiHelper.h" -#include "base/Log.h" - -#include - -size_t DpiHelper::s_dpi = kDefaultDpi; -bool DpiHelper::s_dpiScaled = false; -size_t DpiHelper::s_resolutionWidth = 0; -size_t DpiHelper::s_resolutionHeight = 0; -size_t DpiHelper::s_primaryWidthCenter = 0; -size_t DpiHelper::s_primaryHeightCenter = 0; - -void DpiHelper::calculateDpi(size_t width, size_t height) -{ - if (s_resolutionWidth == 0 || - s_resolutionHeight == 0 || - s_primaryWidthCenter == 0 || - s_primaryHeightCenter == 0) { - return; - } - - size_t dpiTest1 = s_resolutionWidth * 100 / width; - size_t dpiTest2 = s_resolutionHeight * 100 / height; - - if (dpiTest1 == dpiTest2) { - s_dpi = dpiTest1; - - if (s_dpi != kDefaultDpi) { - s_dpiScaled = true; - - LOG((CLOG_DEBUG "DPI: %d%%", s_dpi)); - LOG((CLOG_DEBUG "physical resolution: %d, %d scaled resolution: %d, %d", - s_resolutionWidth, s_resolutionHeight, width, height)); - } - } -} diff --git a/src/lib/synergy/DpiHelper.h b/src/lib/synergy/DpiHelper.h deleted file mode 100644 index 0488a4652..000000000 --- a/src/lib/synergy/DpiHelper.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * synergy -- mouse and keyboard sharing utility - * Copyright (C) 2015 Synergy Seamless Inc. - * - * This package is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * found in the file LICENSE that should have accompanied this file. - * - * This package is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include "common/common.h" - -class DpiHelper { -public: - enum EDpi { - kDefaultDpi = 100 - }; - - static void calculateDpi(size_t width, size_t height); - static float getDpi() { return (float)(s_dpi / 100.0f); } - -public: - static size_t s_dpi; - static bool s_dpiScaled; - static size_t s_resolutionWidth; - static size_t s_resolutionHeight; - static size_t s_primaryWidthCenter; - static size_t s_primaryHeightCenter; -}; diff --git a/src/test/unittests/synergy/DpiHelperTests.cpp b/src/test/unittests/synergy/DpiHelperTests.cpp deleted file mode 100644 index 9dee828ed..000000000 --- a/src/test/unittests/synergy/DpiHelperTests.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * synergy -- mouse and keyboard sharing utility - * Copyright (C) 2015 Synergy Seamless Inc. - * - * This package is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * found in the file LICENSE that should have accompanied this file. - * - * This package is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "synergy/DpiHelper.h" - -#include "test/global/gtest.h" - -void resetStaticVariables() -{ - DpiHelper::s_resolutionWidth = 0; - DpiHelper::s_resolutionHeight = 0; - DpiHelper::s_primaryWidthCenter = 0; - DpiHelper::s_primaryHeightCenter = 0; - DpiHelper::s_dpi = DpiHelper::kDefaultDpi; - DpiHelper::s_dpiScaled = false; -} - -TEST(DpiHelperTests, calculateDpi_samePhysicalAndVirtualResolutions_defaultDpi) -{ - resetStaticVariables(); - - DpiHelper::s_resolutionWidth = 1920; - DpiHelper::s_resolutionHeight = 1080; - DpiHelper::s_primaryWidthCenter = 960; - DpiHelper::s_primaryHeightCenter = 540; - - DpiHelper::calculateDpi(1920, 1080); - - EXPECT_FALSE(DpiHelper::s_dpiScaled); - EXPECT_EQ(DpiHelper::kDefaultDpi, DpiHelper::s_dpi); -} - -TEST(DpiHelperTests, calculateDpi_differentPhysicalAndVirtualResolutions_scaledDpi) -{ - resetStaticVariables(); - - DpiHelper::s_resolutionWidth = 1920; - DpiHelper::s_resolutionHeight = 1080; - DpiHelper::s_primaryWidthCenter = 960; - DpiHelper::s_primaryHeightCenter = 540; - - DpiHelper::calculateDpi(960, 540); - - EXPECT_TRUE(DpiHelper::s_dpiScaled); - EXPECT_EQ(200, DpiHelper::s_dpi); -} - -TEST(DpiHelperTests, calculateDpi_defaultStaticValues_defaultDpi) -{ - resetStaticVariables(); - - DpiHelper::calculateDpi(1920, 1080); - - EXPECT_FALSE(DpiHelper::s_dpiScaled); - EXPECT_EQ(DpiHelper::kDefaultDpi, DpiHelper::s_dpi); -} From c2372bc9a80c4515db70a272512c0bb4f49f1d2f Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Fri, 28 Oct 2016 05:24:07 -0700 Subject: [PATCH 08/53] #5186 Remove accumulate fraction DPI calculation --- src/lib/platform/MSWindowsScreen.cpp | 24 +++--------------------- src/lib/platform/MSWindowsScreen.h | 7 ------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/src/lib/platform/MSWindowsScreen.cpp b/src/lib/platform/MSWindowsScreen.cpp index 1ab3adf08..d6466b9bb 100644 --- a/src/lib/platform/MSWindowsScreen.cpp +++ b/src/lib/platform/MSWindowsScreen.cpp @@ -104,7 +104,6 @@ MSWindowsScreen::MSWindowsScreen( m_xCenter(0), m_yCenter(0), m_multimon(false), m_xCursor(0), m_yCursor(0), - m_xFractionalMove(0.0f), m_yFractionalMove(0.0f), m_sequenceNumber(0), m_mark(0), m_markReceived(0), @@ -570,21 +569,6 @@ void MSWindowsScreen::saveMousePosition(SInt32 x, SInt32 y) { LOG((CLOG_DEBUG5 "saved mouse position for next delta: %+d,%+d", x,y)); } -void MSWindowsScreen::accumulateFractionalMove(float x, float y, SInt32& intX, SInt32& intY) -{ - // Accumulate together the move into the running total - m_xFractionalMove += x; - m_yFractionalMove += y; - - // Return the integer part - intX = (SInt32)m_xFractionalMove; - intY = (SInt32)m_yFractionalMove; - - // And keep only the fractional part - m_xFractionalMove -= intX; - m_yFractionalMove -= intY; -} - UInt32 MSWindowsScreen::registerHotKey(KeyID key, KeyModifierMask mask) { @@ -1365,8 +1349,8 @@ MSWindowsScreen::onMouseMove(SInt32 mx, SInt32 my) { // compute motion delta (relative to the last known // mouse position) - float x = (float)mx - m_xCursor; - float y = (float)my - m_yCursor; + SInt32 x = mx - m_xCursor; + SInt32 y = my - m_yCursor; LOG((CLOG_DEBUG3 "mouse move - motion delta: %+d=(%+d - %+d),%+d=(%+d - %+d)", @@ -1416,9 +1400,7 @@ MSWindowsScreen::onMouseMove(SInt32 mx, SInt32 my) } else { // send motion - SInt32 ix, iy; - accumulateFractionalMove(x, y, ix, iy); - sendEvent(m_events->forIPrimaryScreen().motionOnSecondary(), MotionInfo::alloc(ix, iy)); + sendEvent(m_events->forIPrimaryScreen().motionOnSecondary(), MotionInfo::alloc(x, y)); } } diff --git a/src/lib/platform/MSWindowsScreen.h b/src/lib/platform/MSWindowsScreen.h index 4d947be7f..b1ae0f944 100644 --- a/src/lib/platform/MSWindowsScreen.h +++ b/src/lib/platform/MSWindowsScreen.h @@ -216,10 +216,6 @@ class MSWindowsScreen : public PlatformScreen { // save last position of mouse to compute next delta movement void saveMousePosition(SInt32 x, SInt32 y); - // accumulates together a series of fractional pixel moves, each time - // taking away and returning just the integer part of the running total. - void accumulateFractionalMove(float x, float y, SInt32& intX, SInt32& intY); - // check if it is a modifier key repeating message bool isModifierRepeat(KeyModifierMask oldState, KeyModifierMask state, WPARAM wParam) const; @@ -270,9 +266,6 @@ class MSWindowsScreen : public PlatformScreen { // last mouse position SInt32 m_xCursor, m_yCursor; - // accumulated fractional pixel moves - float m_xFractionalMove, m_yFractionalMove; - // last clipboard UInt32 m_sequenceNumber; From 0d4fd6dcef7e941fa6d916511066cf0653ca11f3 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Fri, 28 Oct 2016 06:00:11 -0700 Subject: [PATCH 09/53] #5186 Reorder some functions call to make it clear --- src/lib/platform/MSWindowsScreen.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/platform/MSWindowsScreen.cpp b/src/lib/platform/MSWindowsScreen.cpp index d6466b9bb..defe2b821 100644 --- a/src/lib/platform/MSWindowsScreen.cpp +++ b/src/lib/platform/MSWindowsScreen.cpp @@ -1590,13 +1590,11 @@ MSWindowsScreen::updateScreenShape() // get shape and center m_w = GetSystemMetrics(SM_CXVIRTUALSCREEN); m_h = GetSystemMetrics(SM_CYVIRTUALSCREEN); - + m_x = GetSystemMetrics(SM_XVIRTUALSCREEN); + m_y = GetSystemMetrics(SM_YVIRTUALSCREEN); m_xCenter = GetSystemMetrics(SM_CXSCREEN) >> 1; m_yCenter = GetSystemMetrics(SM_CYSCREEN) >> 1; - // get position - m_x = GetSystemMetrics(SM_XVIRTUALSCREEN); - m_y = GetSystemMetrics(SM_YVIRTUALSCREEN); // check for multiple monitors m_multimon = (m_w != GetSystemMetrics(SM_CXSCREEN) || m_h != GetSystemMetrics(SM_CYSCREEN)); From 8d193c76b586511586ea33fda3411614631d671b Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Fri, 28 Oct 2016 06:00:46 -0700 Subject: [PATCH 10/53] #5186 Apply DPI aware option in local machine rather than current user in registry --- src/setup/win32/Product.wxs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/setup/win32/Product.wxs b/src/setup/win32/Product.wxs index 20de813af..3663607a9 100644 --- a/src/setup/win32/Product.wxs +++ b/src/setup/win32/Product.wxs @@ -33,7 +33,7 @@ - From 340ee43d90a87ba35375da106315a69c8baf0cfe Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Mon, 31 Oct 2016 17:40:54 +0000 Subject: [PATCH 11/53] #5699 Add Mac deploy argument in configure command If deploy target is not specified, it would use the specified sdk version --- ext/toolchain/commands1.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/ext/toolchain/commands1.py b/ext/toolchain/commands1.py index 9c28ab75f..8e7910f92 100644 --- a/ext/toolchain/commands1.py +++ b/ext/toolchain/commands1.py @@ -41,7 +41,7 @@ class Toolchain: cmd_opt_dict = { 'about' : ['', []], 'setup' : ['g:', ['generator=']], - 'configure' : ['g:dr', ['generator=', 'debug', 'release', 'mac-sdk=', 'mac-identity=']], + 'configure' : ['g:dr', ['generator=', 'debug', 'release', 'mac-sdk=', 'mac-deploy=', 'mac-identity=']], 'build' : ['dr', ['debug', 'release']], 'clean' : ['dr', ['debug', 'release']], 'update' : ['', []], @@ -244,6 +244,9 @@ class InternalCommands: # by default, unknown macSdk = None + # by default, unknown + macDeploy = None + # by default, unknown macIdentity = None @@ -365,7 +368,7 @@ def configure(self, target='', extraArgs=''): # ensure latest setup and do not ask config for generator (only fall # back to prompt if not specified as arg) self.ensure_setup_latest() - + if sys.platform == "darwin": config = self.getConfig() @@ -374,6 +377,11 @@ def configure(self, target='', extraArgs=''): elif config.has_option("hm", "macSdk"): self.macSdk = config.get('hm', 'macSdk') + if self.macDeploy: + config.set('hm', 'macDeploy', self.macDeploy) + elif config.has_option("hm", "macDeploy"): + self.macSdk = config.get('hm', 'macDeploy') + if self.macIdentity: config.set('hm', 'macIdentity', self.macIdentity) elif config.has_option("hm", "macIdentity"): @@ -383,7 +391,10 @@ def configure(self, target='', extraArgs=''): if not self.macSdk: raise Exception("Arg missing: --mac-sdk "); - + + if not self.macDeploy: + self.macDeploy = self.macSdk + if not self.macIdentity: raise Exception("Arg missing: --mac-identity "); @@ -438,7 +449,7 @@ def configureCore(self, target="", extraArgs=""): if generator.cmakeName.find('Unix Makefiles') == -1: sdkDir = self.getMacSdkDir() cmake_args += " -DCMAKE_OSX_SYSROOT=" + sdkDir - cmake_args += " -DCMAKE_OSX_DEPLOYMENT_TARGET=" + self.macSdk + cmake_args += " -DCMAKE_OSX_DEPLOYMENT_TARGET=" + self.macDeploy cmake_args += " -DOSX_TARGET_MAJOR=" + macSdkMatch.group(1) cmake_args += " -DOSX_TARGET_MINOR=" + macSdkMatch.group(2) @@ -1898,6 +1909,8 @@ def __init__(self, argv, opts, args, verbose): self.qtDir = a elif o == '--mac-sdk': self.ic.macSdk = a + elif o == '--mac-deploy': + self.ic.macDeploy = a elif o == '--mac-identity': self.ic.macIdentity = a From 7ce69059351a165e192d717741c267809b154dab Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Tue, 1 Nov 2016 15:22:33 +0000 Subject: [PATCH 12/53] Version to 1.8.6-rc1 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 45c8d9d6a..5b294eee6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,8 +17,8 @@ # Version number for Synergy set(VERSION_MAJOR 1) set(VERSION_MINOR 8) -set(VERSION_REV 5) -set(VERSION_STAGE stable) +set(VERSION_REV 6) +set(VERSION_STAGE rc1) set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}") cmake_minimum_required(VERSION 2.6) From 1a7920f80d86295b7e23017537250fc550632eb5 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Tue, 1 Nov 2016 17:29:25 +0000 Subject: [PATCH 13/53] #5722 Make LicenseManager accept SerialKey object instead of string --- src/gui/src/ActivationDialog.cpp | 3 ++- src/gui/src/LicenseManager.cpp | 14 ++++++++++---- src/gui/src/LicenseManager.h | 3 ++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/gui/src/ActivationDialog.cpp b/src/gui/src/ActivationDialog.cpp index 253ec3ee0..6035dfa88 100644 --- a/src/gui/src/ActivationDialog.cpp +++ b/src/gui/src/ActivationDialog.cpp @@ -71,7 +71,8 @@ void ActivationDialog::accept() std::pair result; try { - QString serialKey = ui->m_pTextEditSerialKey->toPlainText().trimmed(); + SerialKey serialKey (ui->m_pTextEditSerialKey->toPlainText(). + trimmed().toStdString()); result = m_LicenseManager->setSerialKey(serialKey); } catch (std::exception& e) { diff --git a/src/gui/src/LicenseManager.cpp b/src/gui/src/LicenseManager.cpp index 221fd16d8..cd0b6eb92 100644 --- a/src/gui/src/LicenseManager.cpp +++ b/src/gui/src/LicenseManager.cpp @@ -29,11 +29,10 @@ LicenseManager::LicenseManager(AppConfig* appConfig) : } std::pair -LicenseManager::setSerialKey(QString serialKeyString, bool acceptExpired) +LicenseManager::setSerialKey(SerialKey serialKey, bool acceptExpired) { std::pair ret (true, ""); time_t currentTime = ::time(0); - SerialKey serialKey (serialKeyString.toStdString()); if (!acceptExpired && serialKey.isExpired(currentTime)) { ret.first = false; @@ -44,7 +43,8 @@ LicenseManager::setSerialKey(QString serialKeyString, bool acceptExpired) if (serialKey != m_serialKey) { using std::swap; swap (serialKey, m_serialKey); - m_AppConfig->setSerialKey(serialKeyString); + m_AppConfig->setSerialKey(QString::fromStdString + (serialKey.toString())); emit serialKeyChanged(m_serialKey); if (serialKey.isTrial()) { @@ -114,7 +114,13 @@ LicenseManager::serialKey() const void LicenseManager::refresh() { if (!m_AppConfig->serialKey().isEmpty()) { - setSerialKey(m_AppConfig->serialKey(), true); + try { + SerialKey serialKey (m_AppConfig->serialKey().toStdString()); + setSerialKey(serialKey, true); + } catch (...) { + m_AppConfig->setSerialKey(""); + m_AppConfig->saveSettings(); + } } if (m_serialKey.isExpired(::time(0))) { emit endTrial(true); diff --git a/src/gui/src/LicenseManager.h b/src/gui/src/LicenseManager.h index 2dc89cd8d..7ece4e23c 100644 --- a/src/gui/src/LicenseManager.h +++ b/src/gui/src/LicenseManager.h @@ -30,7 +30,8 @@ class LicenseManager: public QObject public: LicenseManager(AppConfig* appConfig); - std::pair setSerialKey(QString serialKey, bool acceptExpired = false); + std::pair setSerialKey(SerialKey serialKey, + bool acceptExpired = false); void refresh(); Edition activeEdition() const; QString activeEditionName() const; From 24a548273edbcaceddba1d3e2085049189b65c07 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Wed, 2 Nov 2016 11:28:04 +0000 Subject: [PATCH 14/53] #5722 Trim serial keys already stored --- src/gui/src/AppConfig.cpp | 2 +- src/gui/src/LicenseManager.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/src/AppConfig.cpp b/src/gui/src/AppConfig.cpp index 06f9f43da..e6d15e63d 100644 --- a/src/gui/src/AppConfig.cpp +++ b/src/gui/src/AppConfig.cpp @@ -161,7 +161,7 @@ void AppConfig::loadSettings() m_ActivateEmail = settings().value("activateEmail", "").toString(); m_CryptoEnabled = settings().value("cryptoEnabled", true).toBool(); m_AutoHide = settings().value("autoHide", false).toBool(); - m_Serialkey = settings().value("serialKey", "").toString(); + m_Serialkey = settings().value("serialKey", "").toString().trimmed(); m_lastVersion = settings().value("lastVersion", "Unknown").toString(); m_LastExpiringWarningTime = settings().value("lastExpiringWarningTime", 0).toInt(); m_ActivationHasRun = settings().value("activationHasRun", false).toBool(); diff --git a/src/gui/src/LicenseManager.cpp b/src/gui/src/LicenseManager.cpp index cd0b6eb92..335dd821b 100644 --- a/src/gui/src/LicenseManager.cpp +++ b/src/gui/src/LicenseManager.cpp @@ -118,7 +118,7 @@ void LicenseManager::refresh() SerialKey serialKey (m_AppConfig->serialKey().toStdString()); setSerialKey(serialKey, true); } catch (...) { - m_AppConfig->setSerialKey(""); + m_AppConfig->clearSerialKey(); m_AppConfig->saveSettings(); } } From 5cccac360c17b59d7613e3e32c43dca88e4162a6 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Wed, 2 Nov 2016 11:55:39 +0000 Subject: [PATCH 15/53] #5699 Add deploy target to GUI configure --- ext/toolchain/commands1.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/toolchain/commands1.py b/ext/toolchain/commands1.py index 8e7910f92..ceadb1fe1 100644 --- a/ext/toolchain/commands1.py +++ b/ext/toolchain/commands1.py @@ -509,8 +509,8 @@ def configureGui(self, target="", extraArgs=""): sdkDir = self.getMacSdkDir() shortForm = "macosx" + self.macSdk version = str(major) + "." + str(minor) - - qmake_cmd_string += " QMAKE_MACOSX_DEPLOYMENT_TARGET=" + version + + qmake_cmd_string += " QMAKE_MACOSX_DEPLOYMENT_TARGET=" + self.macDeploy (qMajor, qMinor, qRev) = self.getQmakeVersion() if qMajor <= 4: From b8233fc1465a958058658124809ad17fb0d13939 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Thu, 3 Nov 2016 14:31:27 +0000 Subject: [PATCH 16/53] #5186 Add deprecated arguments warnings --- src/lib/synergy/ArgParser.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/lib/synergy/ArgParser.cpp b/src/lib/synergy/ArgParser.cpp index b3921e120..83cecdf88 100644 --- a/src/lib/synergy/ArgParser.cpp +++ b/src/lib/synergy/ArgParser.cpp @@ -319,6 +319,26 @@ ArgParser::parseDeprecatedArgs(int argc, const char* const* argv, int& i) i++; return true; } + else if (isArg(i, argc, argv, NULL, "--res-w")) { + LOG((CLOG_NOTE "--res-w is deprecated")); + i++; + return true; + } + else if (isArg(i, argc, argv, NULL, "--res-h")) { + LOG((CLOG_NOTE "--res-h is deprecated")); + i++; + return true; + } + else if (isArg(i, argc, argv, NULL, "--prm-wc")) { + LOG((CLOG_NOTE "--prm-wc is deprecated")); + i++; + return true; + } + else if (isArg(i, argc, argv, NULL, "--prm-hc")) { + LOG((CLOG_NOTE "--prm-hc is deprecated")); + i++; + return true; + } return false; } From f2f4b05c6f7a45395d04b8c0d5d3e00f20a7f543 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Thu, 3 Nov 2016 14:55:36 +0000 Subject: [PATCH 17/53] #5699 Only put MacOSX version number in filename when deploying for exact SDK --- ext/toolchain/commands1.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/toolchain/commands1.py b/ext/toolchain/commands1.py index ceadb1fe1..b5a47217c 100644 --- a/ext/toolchain/commands1.py +++ b/ext/toolchain/commands1.py @@ -1854,7 +1854,10 @@ def getMacPackageName(self): # version is major and minor with no dots (e.g. 106) version = str(major) + str(minor) - return "MacOSX%s-%s" % (version, arch) + if (self.macDeploy == self.macSdk): + return "MacOSX%s-%s" % (version, arch) + else: + return "MacOSX-%s" % arch def reset(self): if os.path.exists('build'): From e6ca9e417dc9b54a042345b03a114f9fac330239 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Thu, 3 Nov 2016 16:42:38 +0000 Subject: [PATCH 18/53] #5699 load deploy target on load config so dist command is aware of it --- ext/toolchain/commands1.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/toolchain/commands1.py b/ext/toolchain/commands1.py index b5a47217c..cbfb31c7d 100644 --- a/ext/toolchain/commands1.py +++ b/ext/toolchain/commands1.py @@ -667,6 +667,9 @@ def loadConfig(self): if config.has_option("hm", "macSdk"): self.macSdk = config.get("hm", "macSdk") + + if config.has_option("hm", "macDeploy"): + self.macDeploy = config.get("hm", "macDeploy") if config.has_option("hm", "macIdentity"): self.macIdentity = config.get("hm", "macIdentity") From e8145aa779feae145aaaf3b4ff5b657f71a91a83 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Tue, 22 Nov 2016 15:19:58 +0000 Subject: [PATCH 19/53] #5592 Post keyboard events to lower level HID client --- src/lib/platform/OSXKeyState.cpp | 168 ++++++++++++++++++++++++--------------- src/lib/platform/OSXKeyState.h | 6 ++ 2 files changed, 109 insertions(+), 65 deletions(-) diff --git a/src/lib/platform/OSXKeyState.cpp b/src/lib/platform/OSXKeyState.cpp index 2071621bf..8ab0bc89a 100644 --- a/src/lib/platform/OSXKeyState.cpp +++ b/src/lib/platform/OSXKeyState.cpp @@ -23,6 +23,7 @@ #include "base/Log.h" #include +#include // Note that some virtual keys codes appear more than once. The // first instance of a virtual key code maps to the KeyID that we @@ -469,6 +470,105 @@ OSXKeyState::getKeyMap(synergy::KeyMap& keyMap) } } +static io_connect_t getEventDriver(void) +{ + static mach_port_t sEventDrvrRef = 0; + mach_port_t masterPort, service, iter; + kern_return_t kr; + + if (!sEventDrvrRef) { + // Get master device port + kr = IOMasterPort(bootstrap_port, &masterPort); + assert(KERN_SUCCESS == kr); + + kr = IOServiceGetMatchingServices(masterPort, + IOServiceMatching(kIOHIDSystemClass), &iter); + assert(KERN_SUCCESS == kr); + + service = IOIteratorNext(iter); + assert(service); + + kr = IOServiceOpen(service, mach_task_self(), + kIOHIDParamConnectType, &sEventDrvrRef); + assert(KERN_SUCCESS == kr); + + IOObjectRelease(service); + IOObjectRelease(iter); + } + + return sEventDrvrRef; +} + +void +OSXKeyState::postHIDVirtualKey(const UInt8 virtualKeyCode, + const bool postDown) +{ + static UInt32 modifiers = 0; + + NXEventData event; + IOGPoint loc = { 0, 0 }; + UInt32 modifiersDelta = 0; + + bzero(&event, sizeof(NXEventData)); + + switch (virtualKeyCode) + { + case s_shiftVK: + case s_superVK: + case s_altVK: + case s_controlVK: + case s_capsLockVK: + switch (virtualKeyCode) + { + case s_shiftVK: + modifiersDelta = NX_SHIFTMASK; + m_shiftPressed = postDown; + break; + case s_superVK: + modifiersDelta = NX_COMMANDMASK; + m_superPressed = postDown; + break; + case s_altVK: + modifiersDelta = NX_ALTERNATEMASK; + m_altPressed = postDown; + break; + case s_controlVK: + modifiersDelta = NX_CONTROLMASK; + m_controlPressed = postDown; + break; + case s_capsLockVK: + modifiersDelta = NX_ALPHASHIFTMASK; + m_capsPressed = postDown; + break; + } + + // update the modifier bit + if (postDown) { + modifiers |= modifiersDelta; + } + else { + modifiers &= ~modifiersDelta; + } + + kern_return_t kr; + kr = IOHIDPostEvent(getEventDriver(), NX_FLAGSCHANGED, loc, + &event, kNXEventDataVersion, modifiers, true); + assert(KERN_SUCCESS == kr); + break; + + default: + event.key.repeat = false; + event.key.keyCode = virtualKeyCode; + event.key.origCharSet = event.key.charSet = NX_ASCIISET; + event.key.origCharCode = event.key.charCode = 0; + kr = IOHIDPostEvent(getEventDriver(), + postDown ? NX_KEYDOWN : NX_KEYUP, + loc, &event, kNXEventDataVersion, 0, false); + assert(KERN_SUCCESS == kr); + break; + } +} + void OSXKeyState::fakeKey(const Keystroke& keystroke) { @@ -477,76 +577,14 @@ OSXKeyState::fakeKey(const Keystroke& keystroke) KeyButton button = keystroke.m_data.m_button.m_button; bool keyDown = keystroke.m_data.m_button.m_press; - UInt32 client = keystroke.m_data.m_button.m_client; - CGEventSourceRef source = 0; CGKeyCode virtualKey = mapKeyButtonToVirtualKey(button); LOG((CLOG_DEBUG1 - " button=0x%04x virtualKey=0x%04x keyDown=%s client=0x%04x", - button, virtualKey, keyDown ? "down" : "up", client)); + " button=0x%04x virtualKey=0x%04x keyDown=%s", + button, virtualKey, keyDown ? "down" : "up")); - CGEventRef ref = CGEventCreateKeyboardEvent( - source, virtualKey, keyDown); - - if (ref == NULL) { - LOG((CLOG_CRIT "unable to create keyboard event for keystroke")); - return; - } - - // persist modifier state. - if (virtualKey == s_shiftVK) { - m_shiftPressed = keyDown; - } - - if (virtualKey == s_controlVK) { - m_controlPressed = keyDown; - } - - if (virtualKey == s_altVK) { - m_altPressed = keyDown; - } - - if (virtualKey == s_superVK) { - m_superPressed = keyDown; - } - - if (virtualKey == s_capsLockVK) { - m_capsPressed = keyDown; - } + postHIDVirtualKey(virtualKey, keyDown); - // set the event flags for special keys - // http://tinyurl.com/pxl742y - CGEventFlags modifiers = 0; - - if (m_shiftPressed) { - modifiers |= kCGEventFlagMaskShift; - } - - if (m_controlPressed) { - modifiers |= kCGEventFlagMaskControl; - } - - if (m_altPressed) { - modifiers |= kCGEventFlagMaskAlternate; - } - - if (m_superPressed) { - modifiers |= kCGEventFlagMaskCommand; - } - - if (m_capsPressed) { - modifiers |= kCGEventFlagMaskAlphaShift; - } - - CGEventSetFlags(ref, modifiers); - CGEventPost(kCGHIDEventTap, ref); - CFRelease(ref); - - // add a delay if client data isn't zero - // FIXME -- why? - if (client != 0) { - ARCH->sleep(0.01); - } break; } diff --git a/src/lib/platform/OSXKeyState.h b/src/lib/platform/OSXKeyState.h index 00dbb5518..a3e16315f 100644 --- a/src/lib/platform/OSXKeyState.h +++ b/src/lib/platform/OSXKeyState.h @@ -149,6 +149,12 @@ class OSXKeyState : public KeyState { static UInt32 mapKeyButtonToVirtualKey(KeyButton keyButton); void init(); + + // Post a key event to HID manager. It posts an event to HID client, a + // much lower level than window manager which's the target from carbon + // CGEventPost + void postHIDVirtualKey(const UInt8 virtualKeyCode, + const bool postDown); private: // OS X uses a physical key if 0 for the 'A' key. synergy reserves From 00db51cd9361055b9eade3ca352e5fa72e6603a2 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Mon, 5 Dec 2016 11:01:53 +0000 Subject: [PATCH 20/53] Ask for logs in issue template --- .github/ISSUE_TEMPLATE.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 590f59a59..b1f62c9bf 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -27,4 +27,6 @@ Client: Applesoft Windy OS 10 * Is there a way to work around it? No/Yes, you can... * Does this bug prevent you from using Synergy entirely? Yes/No +Please follow the link below to send us logs from both your server and client sides if it's appropriate. https://github.com/symless/synergy/wiki/Sending-logs + Put anything else you can think of here. From d8cd60f0570d5c42fdaa92bde4480ad8056e1370 Mon Sep 17 00:00:00 2001 From: XinyuHou Date: Tue, 6 Dec 2016 11:22:54 +0000 Subject: [PATCH 21/53] Version to 1.8.6-rc2 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b294eee6..9a6685768 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ set(VERSION_MAJOR 1) set(VERSION_MINOR 8) set(VERSION_REV 6) -set(VERSION_STAGE rc1) +set(VERSION_STAGE rc2) set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}") cmake_minimum_required(VERSION 2.6) From a49de587381ebe8c739cbadf8daae99bc08965d6 Mon Sep 17 00:00:00 2001 From: XinyuHou Date: Tue, 6 Dec 2016 12:03:40 +0000 Subject: [PATCH 22/53] #5752 Correct tab order in settings dialog --- src/gui/res/SettingsDialogBase.ui | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/res/SettingsDialogBase.ui b/src/gui/res/SettingsDialogBase.ui index dca1bdadd..f604cf7a2 100644 --- a/src/gui/res/SettingsDialogBase.ui +++ b/src/gui/res/SettingsDialogBase.ui @@ -330,11 +330,13 @@ m_pLineEditScreenName m_pSpinBoxPort m_pLineEditInterface + m_pComboElevate + m_pCheckBoxAutoHide + m_pCheckBoxEnableCrypto m_pComboLogLevel m_pCheckBoxLogToFile m_pLineEditLogFilename m_pButtonBrowseLog - buttonBox From 72b1ebcdb2175f7d31d68e30ce24391ab272b718 Mon Sep 17 00:00:00 2001 From: Epakai Date: Sat, 22 Oct 2016 02:00:28 -0500 Subject: [PATCH 23/53] spelling error "unknow => unknown" --- src/lib/synergy/ClipboardChunk.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/synergy/ClipboardChunk.cpp b/src/lib/synergy/ClipboardChunk.cpp index 25c0e2d86..292826ee6 100644 --- a/src/lib/synergy/ClipboardChunk.cpp +++ b/src/lib/synergy/ClipboardChunk.cpp @@ -118,7 +118,7 @@ ClipboardChunk::assemble(synergy::IStream* stream, return kFinish; } - LOG((CLOG_ERR "clipboard transmission failed: unknow error")); + LOG((CLOG_ERR "clipboard transmission failed: unknown error")); return kError; } From 4297673387bfc1c348c8e5b5a06248847ab56985 Mon Sep 17 00:00:00 2001 From: Epakai Date: Sat, 22 Oct 2016 01:59:37 -0500 Subject: [PATCH 24/53] spelling error "implmented => implemented" --- src/lib/arch/unix/ArchSystemUnix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/arch/unix/ArchSystemUnix.cpp b/src/lib/arch/unix/ArchSystemUnix.cpp index 3eb60cfa8..5bcea6190 100644 --- a/src/lib/arch/unix/ArchSystemUnix.cpp +++ b/src/lib/arch/unix/ArchSystemUnix.cpp @@ -76,5 +76,5 @@ ArchSystemUnix::setting(const std::string&, const std::string&) const std::string ArchSystemUnix::getLibsUsed(void) const { - return "not implmented.\nuse lsof on shell"; + return "not implemented.\nuse lsof on shell"; } From e1dc29799f7a5e7d380a596d5e39cda1b51aabc5 Mon Sep 17 00:00:00 2001 From: XinyuHou Date: Tue, 6 Dec 2016 15:18:18 +0000 Subject: [PATCH 25/53] Fix wrong usage example in hm --- ext/toolchain/commands1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/toolchain/commands1.py b/ext/toolchain/commands1.py index cbfb31c7d..f32ec4835 100644 --- a/ext/toolchain/commands1.py +++ b/ext/toolchain/commands1.py @@ -309,7 +309,7 @@ def usage(self): ' genlist Shows the list of available platform generators\n' ' usage Shows the help screen\n' '\n' - 'Example: %s build -g 3' + 'Example: %s conf -g 3' ) % (app, app) def configureAll(self, targets, extraArgs=''): From 74d63df24445cdb95f88f97d8008fb43443bfbc0 Mon Sep 17 00:00:00 2001 From: XinyuHou Date: Wed, 7 Dec 2016 17:28:15 +0000 Subject: [PATCH 26/53] Fix incorrect check of return code from dup --- src/lib/arch/unix/ArchDaemonUnix.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/arch/unix/ArchDaemonUnix.cpp b/src/lib/arch/unix/ArchDaemonUnix.cpp index 91933ab4e..f12ee8f14 100644 --- a/src/lib/arch/unix/ArchDaemonUnix.cpp +++ b/src/lib/arch/unix/ArchDaemonUnix.cpp @@ -117,9 +117,11 @@ ArchDaemonUnix::daemonize(const char* name, DaemonFunc func) open("/dev/null", O_RDWR); int dupErr = dup(1); - if (dupErr) + + if (dupErr < 0) { // NB: file logging actually isn't working at this point! LOG((CLOG_ERR "dup error: %i", dupErr)); + } #ifdef __APPLE__ return execSelfNonDaemonized(); From c31f908fb283dadc1a34856796e2d7a9df7bbb77 Mon Sep 17 00:00:00 2001 From: XinyuHou Date: Wed, 7 Dec 2016 17:35:52 +0000 Subject: [PATCH 27/53] Fix warning in IPC proxy classes --- src/lib/ipc/IpcClientProxy.cpp | 2 +- src/lib/ipc/IpcServerProxy.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/ipc/IpcClientProxy.cpp b/src/lib/ipc/IpcClientProxy.cpp index 8c912a837..5ede6a054 100644 --- a/src/lib/ipc/IpcClientProxy.cpp +++ b/src/lib/ipc/IpcClientProxy.cpp @@ -146,7 +146,7 @@ IpcClientProxy::send(const IpcMessage& message) switch (message.type()) { case kIpcLogLine: { const IpcLogLineMessage& llm = static_cast(message); - String logLine = llm.logLine(); + const String logLine = llm.logLine(); ProtocolUtil::writef(&m_stream, kIpcMsgLogLine, &logLine); break; } diff --git a/src/lib/ipc/IpcServerProxy.cpp b/src/lib/ipc/IpcServerProxy.cpp index 90e87478c..39379f527 100644 --- a/src/lib/ipc/IpcServerProxy.cpp +++ b/src/lib/ipc/IpcServerProxy.cpp @@ -94,7 +94,7 @@ IpcServerProxy::send(const IpcMessage& message) case kIpcCommand: { const IpcCommandMessage& cm = static_cast(message); - String command = cm.command(); + const String command = cm.command(); ProtocolUtil::writef(&m_stream, kIpcMsgCommand, &command); break; } From 5061f51a66253c261110c43d78386e228431e9c4 Mon Sep 17 00:00:00 2001 From: XinyuHou Date: Mon, 12 Dec 2016 16:55:05 +0000 Subject: [PATCH 28/53] Update Changelog --- ChangeLog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 477426ca4..eb209c696 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +v1.8.6-stable +============= +Bug #5592 - Some keys don't work for macOS Sierra clients +Bug #5186 - Cursor stuck on client when using multi-DPI server +Bug #5722 - Malformed serial key in registry will crash GUI on startup +Bug #5752 - Tab order is incorrect on Settings dialog +Enhancement #5699 - Unified installers on macOS +Feature #4836 - macOS Sierra build + v1.8.5-stable ============= Bug #5680 - Server crashes when disconnecting SSL clients From 2ab21aaa011dfaaf2a14c0d17ab210f9012d0d18 Mon Sep 17 00:00:00 2001 From: XinyuHou Date: Mon, 12 Dec 2016 16:55:31 +0000 Subject: [PATCH 29/53] Version to 1.8.6-stable --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a6685768..3492a0c68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ set(VERSION_MAJOR 1) set(VERSION_MINOR 8) set(VERSION_REV 6) -set(VERSION_STAGE rc2) +set(VERSION_STAGE stable) set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}") cmake_minimum_required(VERSION 2.6) From b69570ec2c746948f3987370ff35eba4a93293a4 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Wed, 28 Dec 2016 15:57:15 +0000 Subject: [PATCH 30/53] #5784 Fix using the wrong serial key --- src/gui/src/LicenseManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/src/LicenseManager.cpp b/src/gui/src/LicenseManager.cpp index 335dd821b..6f761135e 100644 --- a/src/gui/src/LicenseManager.cpp +++ b/src/gui/src/LicenseManager.cpp @@ -44,7 +44,7 @@ LicenseManager::setSerialKey(SerialKey serialKey, bool acceptExpired) using std::swap; swap (serialKey, m_serialKey); m_AppConfig->setSerialKey(QString::fromStdString - (serialKey.toString())); + (m_serialKey.toString())); emit serialKeyChanged(m_serialKey); if (serialKey.isTrial()) { From fd6ea65f1a73acd72770a7156c6dc459808334cc Mon Sep 17 00:00:00 2001 From: XinyuHou Date: Wed, 18 Jan 2017 12:43:17 +0000 Subject: [PATCH 31/53] Version to1.8.7-stable --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3492a0c68..7034dc2a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ # Version number for Synergy set(VERSION_MAJOR 1) set(VERSION_MINOR 8) -set(VERSION_REV 6) +set(VERSION_REV 7) set(VERSION_STAGE stable) set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}") From 9799e969037727a0bf07450b60a90aa7412658f1 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Thu, 19 Jan 2017 13:18:10 +0000 Subject: [PATCH 32/53] Update changelog for v1.8.7 --- ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index eb209c696..ebb695d4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +v1.8.7-stable +============= +Bug #5784 - Edition changes when reopening GUI + v1.8.6-stable ============= Bug #5592 - Some keys don't work for macOS Sierra clients From a5140aa1b965a37c68b40ccb990bac6115252c95 Mon Sep 17 00:00:00 2001 From: Nye Liu Date: Wed, 21 Dec 2016 17:36:31 -0800 Subject: [PATCH 33/53] Fix typo in compiler flags --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7034dc2a7..328163a1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,7 +77,7 @@ if (UNIX) # warnings as errors: # we have a problem with people checking in code with warnings. - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-unused-local-typedef") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-unused-local-typedefs") if (NOT APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") From 3bb833b7983caaab2420204bb966fdf0d8490a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=8A=E5=86=B2?= Date: Fri, 7 Nov 2014 10:59:45 +0800 Subject: [PATCH 34/53] #4193 System tray is unavailable on KDE5 --- src/gui/src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/src/main.cpp b/src/gui/src/main.cpp index f7be9fbf7..cf4d0c1ee 100644 --- a/src/gui/src/main.cpp +++ b/src/gui/src/main.cpp @@ -119,8 +119,8 @@ int waitForTray() if (++trayAttempts > TRAY_RETRY_COUNT) { QMessageBox::critical(NULL, "Synergy", - QObject::tr("System tray is unavailable, quitting.")); - return false; + QObject::tr("System tray is unavailable, don't close your window.")); + return true; } QThreadImpl::msleep(TRAY_RETRY_WAIT); From 3d3b7ca8810f283d2134cdb3fc92b77ef0233c1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Oliveira?= Date: Tue, 23 Dec 2014 15:15:53 +0000 Subject: [PATCH 35/53] #4288 Remove auto Alt+Printscreen on Windows As per issue https://github.com/synergy/synergy/issues/4288 --- src/lib/platform/MSWindowsKeyState.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/lib/platform/MSWindowsKeyState.cpp b/src/lib/platform/MSWindowsKeyState.cpp index 9c4e729a7..f94eedcd9 100644 --- a/src/lib/platform/MSWindowsKeyState.cpp +++ b/src/lib/platform/MSWindowsKeyState.cpp @@ -1071,11 +1071,6 @@ MSWindowsKeyState::getKeyMap(synergy::KeyMap& keyMap) } } - // add alt+printscreen - if (m_buttonToVK[0x54u] == 0) { - m_buttonToVK[0x54u] = VK_SNAPSHOT; - } - // set virtual key to button table if (GetKeyboardLayout(0) == m_groups[g]) { for (KeyButton i = 0; i < 512; ++i) { From f5944278ededd3d20e9ae7816012ef2167b82e8a Mon Sep 17 00:00:00 2001 From: zbrode Date: Sun, 8 Mar 2015 11:31:34 +1100 Subject: [PATCH 36/53] #4419 We never define _BYTE_ORDER so don't test for it. --- src/micro/uSynergy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/micro/uSynergy.h b/src/micro/uSynergy.h index 44534d248..3d064d513 100644 --- a/src/micro/uSynergy.h +++ b/src/micro/uSynergy.h @@ -46,7 +46,7 @@ extern "C" { #error "Can't define both USYNERGY_LITTLE_ENDIAN and USYNERGY_BIG_ENDIAN" #elif !defined(USYNERGY_LITTLE_ENDIAN) && !defined(USYNERGY_BIG_ENDIAN) /* Attempt to auto detect */ - #if defined(__LITTLE_ENDIAN__) || defined(LITTLE_ENDIAN) || (_BYTE_ORDER == _LITTLE_ENDIAN) + #if defined(__LITTLE_ENDIAN__) || defined(LITTLE_ENDIAN) #define USYNERGY_LITTLE_ENDIAN #elif defined(__BIG_ENDIAN__) || defined(BIG_ENDIAN) || (_BYTE_ORDER == _BIG_ENDIAN) #define USYNERGY_BIG_ENDIAN From 21d4e6a908270fd9f1db9665ebff6a6dcedf2065 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Wed, 25 Mar 2015 14:27:49 +0100 Subject: [PATCH 37/53] #4477 Only allow mouse buttons 1-10 for XTestFakeButtons call. These are the only valid ones: [~]>for i in `seq 0 1 11`; do echo Testing $i; xte "mouseclick $i"; done Testing 0 X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 132 (XTEST) Minor opcode of failed request: 2 (X_XTestFakeInput) Value in failed request: 0x0 Serial number of failed request: 12 Current serial number in output stream: 15 Testing 1 Testing 2 Testing 3 Testing 4 Testing 5 Testing 6 Testing 7 Testing 8 Testing 9 Testing 10 Testing 11 X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 132 (XTEST) Minor opcode of failed request: 2 (X_XTestFakeInput) Value in failed request: 0xb Serial number of failed request: 12 And there are mice out there where buttons 11+ can be pressed accidentally, terminating the synergy client and often leaving the system in a bad state. --- src/lib/platform/XWindowsScreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/platform/XWindowsScreen.cpp b/src/lib/platform/XWindowsScreen.cpp index c70324705..211bb15b6 100644 --- a/src/lib/platform/XWindowsScreen.cpp +++ b/src/lib/platform/XWindowsScreen.cpp @@ -827,7 +827,7 @@ void XWindowsScreen::fakeMouseButton(ButtonID button, bool press) { const unsigned int xButton = mapButtonToX(button); - if (xButton != 0) { + if (xButton > 0 && xButton < 11) { XTestFakeButtonEvent(m_display, xButton, press ? True : False, CurrentTime); XFlush(m_display); From 8e6bf5323327ff43e10c6faa6822586e037481b4 Mon Sep 17 00:00:00 2001 From: Jee-Yong Um Date: Sun, 5 Apr 2015 13:30:18 +0900 Subject: [PATCH 38/53] #4504 Improve Korean language description --- src/gui/res/lang/Languages.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/res/lang/Languages.xml b/src/gui/res/lang/Languages.xml index 0a7f3d98a..5948f9c6f 100644 --- a/src/gui/res/lang/Languages.xml +++ b/src/gui/res/lang/Languages.xml @@ -36,11 +36,11 @@ - + - + From ba55369d42510fff46b26096f2c77d82dc19db8b Mon Sep 17 00:00:00 2001 From: Andreas Eriksson Date: Mon, 18 May 2015 22:37:32 +0200 Subject: [PATCH 39/53] #3197 Disable regular motion events when using XInput 2 --- src/lib/platform/XWindowsScreen.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/lib/platform/XWindowsScreen.cpp b/src/lib/platform/XWindowsScreen.cpp index 211bb15b6..5c29499ad 100644 --- a/src/lib/platform/XWindowsScreen.cpp +++ b/src/lib/platform/XWindowsScreen.cpp @@ -160,15 +160,12 @@ XWindowsScreen::XWindowsScreen( // primary/secondary screen only initialization if (m_isPrimary) { - // start watching for events on other windows - selectEvents(m_root); +#ifdef HAVE_XI2 m_xi2detected = detectXI2(); - if (m_xi2detected) { -#ifdef HAVE_XI2 selectXIRawMotion(); -#endif } else +#endif { // start watching for events on other windows selectEvents(m_root); @@ -745,7 +742,7 @@ XWindowsScreen::registerHotKey(KeyID key, KeyModifierMask mask) LOG((CLOG_WARN "failed to register hotkey %s (id=%04x mask=%04x)", synergy::KeyMap::formatKey(key, mask).c_str(), key, mask)); return 0; } - + LOG((CLOG_DEBUG "registered hotkey %s (id=%04x mask=%04x) as id=%d", synergy::KeyMap::formatKey(key, mask).c_str(), key, mask, id)); return id; } @@ -1300,7 +1297,7 @@ XWindowsScreen::handleSystemEvent(const Event& event, void*) // handle the event ourself switch (xevent->type) { case CreateNotify: - if (m_isPrimary) { + if (m_isPrimary && !m_xi2detected) { // select events on new window selectEvents(xevent->xcreatewindow.window); } From 0eff5a95bea3c0d21c6adfa468f7696853c10692 Mon Sep 17 00:00:00 2001 From: James McMullan Date: Wed, 3 Dec 2014 16:47:05 -0500 Subject: [PATCH 40/53] #3992 macOS: Dragging broken in Unity OSXScreen was not adding mouse movement deltas to mouse events while dragging. Some 3D applications rely on these deltas to implement dragging. Adding the mouse deltas to the mouse event fixes dragging in these applications. Ex: Unity3d --- src/lib/platform/OSXScreen.mm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/lib/platform/OSXScreen.mm b/src/lib/platform/OSXScreen.mm index 2c2e66d6b..992144e44 100644 --- a/src/lib/platform/OSXScreen.mm +++ b/src/lib/platform/OSXScreen.mm @@ -496,7 +496,23 @@ // Fix for sticky keys CGEventFlags modifiers = m_keyState->getModifierStateAsOSXFlags(); CGEventSetFlags(event, modifiers); - + + // Set movement deltas to fix issues with certain 3D programs + SInt64 deltaX = pos.x; + deltaX -= m_xCursor; + + SInt64 deltaY = pos.y; + deltaY -= m_yCursor; + + CGEventSetIntegerValueField(event, kCGMouseEventDeltaX, deltaX); + CGEventSetIntegerValueField(event, kCGMouseEventDeltaY, deltaY); + + double deltaFX = deltaX; + double deltaFY = deltaY; + + CGEventSetDoubleValueField(event, kCGMouseEventDeltaX, deltaFX); + CGEventSetDoubleValueField(event, kCGMouseEventDeltaY, deltaFY); + CGEventPost(kCGHIDEventTap, event); CFRelease(event); From b5a81579edda523eb131c2fe803cdc0b839c9419 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 20 Jan 2017 22:57:53 +0000 Subject: [PATCH 41/53] #5809 macOS: Add a version key to Info.plist --- src/gui/res/mac/Info.plist | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/src/gui/res/mac/Info.plist b/src/gui/res/mac/Info.plist index 5cd23eaf8..7e79c2b6b 100644 --- a/src/gui/res/mac/Info.plist +++ b/src/gui/res/mac/Info.plist @@ -1,20 +1,28 @@ - - + - - CFBundleInfoDictionaryVersion - 6.0 - NSPrincipalClass - NSApplication - CFBundleIconFile - Synergy.icns - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleExecutable - Synergy - CFBundleIdentifier - synergy - - + + CFBundleDevelopmentRegion + English + CFBundleDisplayName + Synergy + CFBundleExecutable + Synergy + CFBundleIconFile + Synergy.icns + CFBundleIdentifier + synergy + + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Synergy + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.8.7 + CFBundleVersion + 1.8.7 + NSHumanReadableCopyright + © 2012-2016, Symless Ltd + + \ No newline at end of file From adf34eba406211564503042d9631bbe304db8d93 Mon Sep 17 00:00:00 2001 From: Mike Hobbs Date: Thu, 29 Dec 2016 11:32:41 -0600 Subject: [PATCH 42/53] #5785 Fix screen switch problem when cursor is in a corner --- src/lib/server/Server.cpp | 74 ++++++++++++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 30 deletions(-) diff --git a/src/lib/server/Server.cpp b/src/lib/server/Server.cpp index c980d03b3..fd90f5f3a 100644 --- a/src/lib/server/Server.cpp +++ b/src/lib/server/Server.cpp @@ -1766,52 +1766,66 @@ Server::onMouseMovePrimary(SInt32 x, SInt32 y) } // see if we should change screens - EDirection dir; + // when the cursor is in a corner, there may be a screen either + // horizontally or vertically. check both directions. + EDirection dirh = kNoDirection, dirv = kNoDirection; + SInt32 xh = x, yv = y; if (x < ax + zoneSize) { - x -= zoneSize; - dir = kLeft; + xh -= zoneSize; + dirh = kLeft; } else if (x >= ax + aw - zoneSize) { - x += zoneSize; - dir = kRight; + xh += zoneSize; + dirh = kRight; } - else if (y < ay + zoneSize) { - y -= zoneSize; - dir = kTop; + if (y < ay + zoneSize) { + yv -= zoneSize; + dirv = kTop; } else if (y >= ay + ah - zoneSize) { - y += zoneSize; - dir = kBottom; + yv += zoneSize; + dirv = kBottom; } - else { + if (dirh == kNoDirection && dirv == kNoDirection) { // still on local screen noSwitch(x, y); return false; } - // get jump destination - BaseClientProxy* newScreen = mapToNeighbor(m_active, dir, x, y); + // check both horizontally and vertically + EDirection dirs[] = {dirh, dirv}; + SInt32 xs[] = {xh, x}, ys[] = {y, yv}; + for (int i = 0; i < 2; ++i) { + EDirection dir = dirs[i]; + if (dir == kNoDirection) { + continue; + } + x = xs[i], y = ys[i]; + + // get jump destination + BaseClientProxy* newScreen = mapToNeighbor(m_active, dir, x, y); + + // should we switch or not? + if (isSwitchOkay(newScreen, dir, x, y, xc, yc)) { + if (m_args.m_enableDragDrop + && m_screen->isDraggingStarted() + && m_active != newScreen + && m_waitDragInfoThread) { + if (m_sendDragInfoThread == NULL) { + m_sendDragInfoThread = new Thread( + new TMethodJob( + this, + &Server::sendDragInfoThread, newScreen)); + } - // should we switch or not? - if (isSwitchOkay(newScreen, dir, x, y, xc, yc)) { - if (m_args.m_enableDragDrop - && m_screen->isDraggingStarted() - && m_active != newScreen - && m_waitDragInfoThread) { - if (m_sendDragInfoThread == NULL) { - m_sendDragInfoThread = new Thread( - new TMethodJob( - this, - &Server::sendDragInfoThread, newScreen)); + return false; } - return false; + // switch screen + switchScreen(newScreen, x, y, false); + m_waitDragInfoThread = true; + return true; } - - // switch screen - switchScreen(newScreen, x, y, false); - m_waitDragInfoThread = true; - return true; } return false; From 180d3e57d25025252c04d4e87819bb6b4fd370d3 Mon Sep 17 00:00:00 2001 From: Jiwoong Yoo Date: Thu, 26 Jan 2017 06:04:13 +0900 Subject: [PATCH 43/53] #5196 Korean and Japanese keyboards have same key code --- src/lib/platform/MSWindowsKeyState.cpp | 29 +++++++++++++++++----- src/lib/platform/MSWindowsKeyState.h | 2 +- src/lib/synergy/key_types.h | 6 +++-- .../integtests/platform/MSWindowsKeyStateTests.cpp | 21 ++++++++++++++++ 4 files changed, 49 insertions(+), 9 deletions(-) diff --git a/src/lib/platform/MSWindowsKeyState.cpp b/src/lib/platform/MSWindowsKeyState.cpp index f94eedcd9..88ba9f244 100644 --- a/src/lib/platform/MSWindowsKeyState.cpp +++ b/src/lib/platform/MSWindowsKeyState.cpp @@ -61,11 +61,11 @@ const KeyID MSWindowsKeyState::s_virtualKey[] = /* 0x012 */ { kKeyAlt_L }, // VK_MENU /* 0x013 */ { kKeyPause }, // VK_PAUSE /* 0x014 */ { kKeyCapsLock }, // VK_CAPITAL - /* 0x015 */ { kKeyHangulKana }, // VK_HANGUL, VK_KANA + /* 0x015 */ { kKeyKana }, // VK_HANGUL, VK_KANA /* 0x016 */ { kKeyNone }, // undefined /* 0x017 */ { kKeyNone }, // VK_JUNJA /* 0x018 */ { kKeyNone }, // VK_FINAL - /* 0x019 */ { kKeyHanjaKanzi }, // VK_KANJI + /* 0x019 */ { kKeyKanzi }, // VK_HANJA, VK_KANJI /* 0x01a */ { kKeyNone }, // undefined /* 0x01b */ { kKeyEscape }, // VK_ESCAPE /* 0x01c */ { kKeyHenkan }, // VK_CONVERT @@ -318,11 +318,11 @@ const KeyID MSWindowsKeyState::s_virtualKey[] = /* 0x112 */ { kKeyAlt_R }, // VK_MENU /* 0x113 */ { kKeyNone }, // VK_PAUSE /* 0x114 */ { kKeyNone }, // VK_CAPITAL - /* 0x115 */ { kKeyNone }, // VK_KANA - /* 0x116 */ { kKeyNone }, // VK_HANGUL + /* 0x115 */ { kKeyHangul }, // VK_HANGUL + /* 0x116 */ { kKeyNone }, // undefined /* 0x117 */ { kKeyNone }, // VK_JUNJA /* 0x118 */ { kKeyNone }, // VK_FINAL - /* 0x119 */ { kKeyNone }, // VK_KANJI + /* 0x119 */ { kKeyHanja }, // VK_HANJA /* 0x11a */ { kKeyNone }, // undefined /* 0x11b */ { kKeyNone }, // VK_ESCAPE /* 0x11c */ { kKeyNone }, // VK_CONVERT @@ -728,6 +728,10 @@ MSWindowsKeyState::mapKeyFromEvent(WPARAM charAndVirtKey, // that so we clear it. active &= ~s_controlAlt; } + if (id == kKeyHangul) { + // If shift-space is used to change input mode, clear shift modifier. + active &= ~KeyModifierShift; + } *maskOut = active; } @@ -1334,8 +1338,20 @@ MSWindowsKeyState::setWindowGroup(SInt32 group) } KeyID -MSWindowsKeyState::getKeyID(UINT virtualKey, KeyButton button) +MSWindowsKeyState::getKeyID(UINT virtualKey, KeyButton button) const { + // Some virtual keycodes have same values. + // VK_HANGUL == VK_KANA, VK_HANJA == NK_KANJI + // which are used to change the input mode of IME. + // But they have different X11 keysym. So we should distinguish them. + if ((LOWORD(m_keyLayout) & 0xffffu) == 0x0412u) { // 0x0412 : Korean Locale ID + if (virtualKey == VK_HANGUL || virtualKey == VK_HANJA) { + // If shift-space is used to change the input mode, + // the extented bit is not set. So add it to get right key id. + button |= 0x100u; + } + } + if ((button & 0x100u) != 0) { virtualKey += 0x100u; } @@ -1387,3 +1403,4 @@ MSWindowsKeyState::addKeyEntry(synergy::KeyMap& keyMap, synergy::KeyMap::KeyItem m_keyToVKMap[item.m_id] = static_cast(item.m_client); } } + diff --git a/src/lib/platform/MSWindowsKeyState.h b/src/lib/platform/MSWindowsKeyState.h index 4313f741a..fcbd5d98b 100644 --- a/src/lib/platform/MSWindowsKeyState.h +++ b/src/lib/platform/MSWindowsKeyState.h @@ -122,7 +122,7 @@ class MSWindowsKeyState : public KeyState { (button should include the extended key bit), or kKeyNone if there is no such key. */ - static KeyID getKeyID(UINT virtualKey, KeyButton button); + KeyID getKeyID(UINT virtualKey, KeyButton button) const; //! Map button to virtual key /*! diff --git a/src/lib/synergy/key_types.h b/src/lib/synergy/key_types.h index ea9387b1c..f45cea242 100644 --- a/src/lib/synergy/key_types.h +++ b/src/lib/synergy/key_types.h @@ -110,10 +110,12 @@ static const KeyID kKeyScrollLock = 0xEF14; static const KeyID kKeySysReq = 0xEF15; static const KeyID kKeyEscape = 0xEF1B; static const KeyID kKeyHenkan = 0xEF23; /* Start/Stop Conversion */ -static const KeyID kKeyHangulKana = 0xEF26; /* Hangul, Kana */ +static const KeyID kKeyKana = 0xEF26; /* Kana */ static const KeyID kKeyHiraganaKatakana = 0xEF27; /* Hiragana/Katakana toggle */ static const KeyID kKeyZenkaku = 0xEF2A; /* Zenkaku/Hankaku */ -static const KeyID kKeyHanjaKanzi = 0xEF2A; /* Hanja, Kanzi */ +static const KeyID kKeyKanzi = 0xEF2A; /* Kanzi */ +static const KeyID kKeyHangul = 0xEF31; /* Hangul */ +static const KeyID kKeyHanja = 0xEF34; /* Hanja */ static const KeyID kKeyDelete = 0xEFFF; /* Delete, rubout */ // cursor control diff --git a/src/test/integtests/platform/MSWindowsKeyStateTests.cpp b/src/test/integtests/platform/MSWindowsKeyStateTests.cpp index c7a4b666c..0affab6e6 100644 --- a/src/test/integtests/platform/MSWindowsKeyStateTests.cpp +++ b/src/test/integtests/platform/MSWindowsKeyStateTests.cpp @@ -121,3 +121,24 @@ TEST_F(MSWindowsKeyStateTests, saveModifiers_noModifiers_savedModifiers0) ASSERT_EQ(0, keyState.getSavedModifiers()); delete desks; } + +TEST_F(MSWindowsKeyStateTests, testKoreanLocale_inputModeKey_resultCorrectKeyID) +{ + NiceMock eventQueue; + MSWindowsDesks* desks = newDesks(&eventQueue); + MockKeyMap keyMap; + MSWindowsKeyState keyState(desks, getEventTarget(), &eventQueue, keyMap); + + keyState.setKeyLayout((HKL)0x00000412u); // for ko-KR local ID + ASSERT_EQ(0xEF31, keyState.getKeyID(0x15u, 0x1f2u)); // VK_HANGUL from Hangul key + ASSERT_EQ(0xEF34, keyState.getKeyID(0x19u, 0x1f1u)); // VK_HANJA from Hanja key + ASSERT_EQ(0xEF31, keyState.getKeyID(0x15u, 0x11du)); // VK_HANGUL from R-Alt key + ASSERT_EQ(0xEF34, keyState.getKeyID(0x19u, 0x138u)); // VK_HANJA from R-Ctrl key + + keyState.setKeyLayout((HKL)0x00000411); // for ja-jp locale ID + ASSERT_EQ(0xEF26, keyState.getKeyID(0x15u, 0x1du)); // VK_KANA + ASSERT_EQ(0xEF2A, keyState.getKeyID(0x19u, 0x38u)); // VK_KANJI + + delete desks; +} + From f35e3e5e06bbe14ec54be4e5d66585b4cef4a47a Mon Sep 17 00:00:00 2001 From: Jiwoong Yoo Date: Thu, 26 Jan 2017 06:07:44 +0900 Subject: [PATCH 44/53] #5578 Virtual key table mapped for inactive IMEs Virtual key table is mapped for all IMEs not just active IME. And this causes the wrong modifier key to be pressed. For example, if you use Korean and Japanese IMEs, pressing the Hangul key makes alt key pressed. So when I press just 'a', client interprets that as 'alt-a'. --- src/lib/platform/MSWindowsKeyState.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/platform/MSWindowsKeyState.cpp b/src/lib/platform/MSWindowsKeyState.cpp index 88ba9f244..4e093bd35 100644 --- a/src/lib/platform/MSWindowsKeyState.cpp +++ b/src/lib/platform/MSWindowsKeyState.cpp @@ -1076,7 +1076,7 @@ MSWindowsKeyState::getKeyMap(synergy::KeyMap& keyMap) } // set virtual key to button table - if (GetKeyboardLayout(0) == m_groups[g]) { + if (activeLayout == m_groups[g]) { for (KeyButton i = 0; i < 512; ++i) { if (m_buttonToVK[i] != 0) { if (m_virtualKeyToButton[m_buttonToVK[i]] == 0) { From 1499f7b27c5b4b34644652a7c1dcf0f387a0febc Mon Sep 17 00:00:00 2001 From: Reinder Feenstra Date: Wed, 25 Jan 2017 22:11:13 +0100 Subject: [PATCH 45/53] #5525 Add support for floating point start/end range values --- src/lib/server/Config.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/server/Config.cpp b/src/lib/server/Config.cpp index dac8f58ea..e50cf1d2e 100644 --- a/src/lib/server/Config.cpp +++ b/src/lib/server/Config.cpp @@ -2096,11 +2096,11 @@ ConfigReadContext::parseInterval(const ArgList& args) const } char* end; - long startValue = strtol(args[0].c_str(), &end, 10); + double startValue = strtod(args[0].c_str(), &end); if (end[0] != '\0') { throw XConfigRead(*this, "invalid interval \"%{1}\"", concatArgs(args)); } - long endValue = strtol(args[1].c_str(), &end, 10); + double endValue = strtod(args[1].c_str(), &end); if (end[0] != '\0') { throw XConfigRead(*this, "invalid interval \"%{1}\"", concatArgs(args)); } From 4b913b5599a2351aabbe5854e5c3207004132724 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Tue, 31 Jan 2017 12:17:33 +0000 Subject: [PATCH 46/53] v1.8.8-rc1 --- CMakeLists.txt | 4 ++-- src/gui/res/mac/Info.plist | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 328163a1c..0fc1097b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,8 +17,8 @@ # Version number for Synergy set(VERSION_MAJOR 1) set(VERSION_MINOR 8) -set(VERSION_REV 7) -set(VERSION_STAGE stable) +set(VERSION_REV 8) +set(VERSION_STAGE rc1) set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}") cmake_minimum_required(VERSION 2.6) diff --git a/src/gui/res/mac/Info.plist b/src/gui/res/mac/Info.plist index 7e79c2b6b..b2d87e095 100644 --- a/src/gui/res/mac/Info.plist +++ b/src/gui/res/mac/Info.plist @@ -19,10 +19,10 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.8.7 + 1.8.8 CFBundleVersion - 1.8.7 + 1.8.8 NSHumanReadableCopyright © 2012-2016, Symless Ltd - \ No newline at end of file + From 2643cea67bed960a3ae57ba881cd06f52843fa62 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Mon, 6 Feb 2017 10:51:16 +0000 Subject: [PATCH 47/53] #5074 Nuke -Werror. It's dumb right now --- CMakeLists.txt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0fc1097b1..635f328b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ set(VERSION_MAJOR 1) set(VERSION_MINOR 8) set(VERSION_REV 8) -set(VERSION_STAGE rc1) +set(VERSION_STAGE rc1) set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}") cmake_minimum_required(VERSION 2.6) @@ -74,11 +74,6 @@ endif() # Depending on the platform, pass in the required defines. if (UNIX) - - # warnings as errors: - # we have a problem with people checking in code with warnings. - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-unused-local-typedefs") - if (NOT APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") endif() From 2d9ed0d3355007a67599e445947f17d8645a2f1e Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Mon, 6 Feb 2017 12:04:52 +0000 Subject: [PATCH 48/53] Updated Changelog --- ChangeLog | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index ebb695d4d..5ccc80f6f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +v1.8.8-rc1 +========== +Bug #5196 - Some keys on Korean and Japanese keyboards have the same keycode +Bug #5578 - Pressing Hangul key results in alt+'a' +Bug #5785 - Can't switch screens when cursor is in a corner +Bug #3992 - macOS: Dragging is broken in Unity 3D +Bug #5075 - macOS: Build fails on macOS 10.9 due to unknown compiler flag +Bug #5809 - macOS: No version number is shown in the App Info dialog +Bug #3197 - Linux: switchDoubleTap option is not working +Bug #4477 - Linux: Mouse buttons higher than id 10 result in crash +Enhancement #4504 - Improved Korean language description +Enhancement #5525 - Added support for precise screen positioning in config file +Enhancement #4290 - Windows: Removed annoying alt+print screen functionality + v1.8.7-stable ============= Bug #5784 - Edition changes when reopening GUI From ed17e9275d55495d06e7f61127ee5de63c642a1f Mon Sep 17 00:00:00 2001 From: Martin Wilck Date: Mon, 6 Feb 2017 12:37:43 +0100 Subject: [PATCH 49/53] XRandR: fix screen size calculation XWindowsScreen::saveShape() using XRRSizes / XRRRotations to calculate screen dimensions when XRandR and a rotated screen was detected. This is wrong. The screen dimensions in the display properties already reflect rotation. Moreover, on servers supporting XRandR >= 1.2, the XRRSizes() and XRRRotations calls from XRandR 1.1 will return the properties of the "primary output" in XRandR 1.2 terms rather than the properties of the entire screen. --- src/lib/platform/XWindowsScreen.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/lib/platform/XWindowsScreen.cpp b/src/lib/platform/XWindowsScreen.cpp index 5c29499ad..6a0d72bfc 100644 --- a/src/lib/platform/XWindowsScreen.cpp +++ b/src/lib/platform/XWindowsScreen.cpp @@ -974,22 +974,6 @@ XWindowsScreen::saveShape() m_w = WidthOfScreen(DefaultScreenOfDisplay(m_display)); m_h = HeightOfScreen(DefaultScreenOfDisplay(m_display)); -#if HAVE_X11_EXTENSIONS_XRANDR_H - if (m_xrandr){ - int numSizes; - XRRScreenSize* xrrs; - Rotation rotation; - xrrs = XRRSizes(m_display, DefaultScreen(m_display), &numSizes); - XRRRotations(m_display, DefaultScreen(m_display), &rotation); - if (xrrs != NULL) { - if (rotation & (RR_Rotate_90|RR_Rotate_270) ){ - m_w = xrrs->height; - m_h = xrrs->width; - } - } - } -#endif - // get center of default screen m_xCenter = m_x + (m_w >> 1); m_yCenter = m_y + (m_h >> 1); From fc3cc78c3e048b8c38d170a1bcd9120c89f02a3b Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Mon, 6 Feb 2017 12:47:19 +0000 Subject: [PATCH 50/53] Update changelog... again --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 5ccc80f6f..3a8df3676 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ Bug #5075 - macOS: Build fails on macOS 10.9 due to unknown compiler flag Bug #5809 - macOS: No version number is shown in the App Info dialog Bug #3197 - Linux: switchDoubleTap option is not working Bug #4477 - Linux: Mouse buttons higher than id 10 result in crash +Bug #5832 - Linux: Screen size misdetected on multi-monitor display Enhancement #4504 - Improved Korean language description Enhancement #5525 - Added support for precise screen positioning in config file Enhancement #4290 - Windows: Removed annoying alt+print screen functionality From c5b83ce4c47b53d9243a59d84463544059845bdf Mon Sep 17 00:00:00 2001 From: Epakai Date: Sun, 12 Feb 2017 15:18:44 -0600 Subject: [PATCH 51/53] Fix ClipboardChunkTests unit test (Fixes #5840) --- src/test/unittests/synergy/ClipboardChunkTests.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/test/unittests/synergy/ClipboardChunkTests.cpp b/src/test/unittests/synergy/ClipboardChunkTests.cpp index 2460778a7..e1c3336e0 100644 --- a/src/test/unittests/synergy/ClipboardChunkTests.cpp +++ b/src/test/unittests/synergy/ClipboardChunkTests.cpp @@ -26,9 +26,11 @@ TEST(ClipboardChunkTests, start_formatStartChunk) UInt32 sequence = 0; String mockDataSize("10"); ClipboardChunk* chunk = ClipboardChunk::start(id, sequence, mockDataSize); + UInt32 temp_m_chunk; + memcpy(&temp_m_chunk, &(chunk->m_chunk[1]), 4); EXPECT_EQ(id, chunk->m_chunk[0]); - EXPECT_EQ(sequence, (UInt32)chunk->m_chunk[1]); + EXPECT_EQ(sequence, temp_m_chunk); EXPECT_EQ(kDataStart, chunk->m_chunk[5]); EXPECT_EQ('1', chunk->m_chunk[6]); EXPECT_EQ('0', chunk->m_chunk[7]); @@ -43,9 +45,11 @@ TEST(ClipboardChunkTests, data_formatDataChunk) UInt32 sequence = 1; String mockData("mock data"); ClipboardChunk* chunk = ClipboardChunk::data(id, sequence, mockData); + UInt32 temp_m_chunk; + memcpy(&temp_m_chunk, &(chunk->m_chunk[1]), 4); EXPECT_EQ(id, chunk->m_chunk[0]); - EXPECT_EQ(sequence, (UInt32)chunk->m_chunk[1]); + EXPECT_EQ(sequence, temp_m_chunk); EXPECT_EQ(kDataChunk, chunk->m_chunk[5]); EXPECT_EQ('m', chunk->m_chunk[6]); EXPECT_EQ('o', chunk->m_chunk[7]); @@ -66,9 +70,11 @@ TEST(ClipboardChunkTests, end_formatDataChunk) ClipboardID id = 1; UInt32 sequence = 1; ClipboardChunk* chunk = ClipboardChunk::end(id, sequence); + UInt32 temp_m_chunk; + memcpy(&temp_m_chunk, &(chunk->m_chunk[1]), 4); EXPECT_EQ(id, chunk->m_chunk[0]); - EXPECT_EQ(sequence, (UInt32)chunk->m_chunk[1]); + EXPECT_EQ(sequence, temp_m_chunk); EXPECT_EQ(kDataEnd, chunk->m_chunk[5]); EXPECT_EQ('\0', chunk->m_chunk[6]); From 5909df9ee72de9a401421dc1cd306dce97e760a5 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 3 Mar 2017 13:41:07 +0000 Subject: [PATCH 52/53] v1.8.8-stable --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 635f328b4..94c474e8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ set(VERSION_MAJOR 1) set(VERSION_MINOR 8) set(VERSION_REV 8) -set(VERSION_STAGE rc1) +set(VERSION_STAGE stable) set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}") cmake_minimum_required(VERSION 2.6) From ec56ac4485ef8e3cf986107b8456949b5aec3527 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 3 Mar 2017 14:51:23 +0000 Subject: [PATCH 53/53] Fix version number in Changelog --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3a8df3676..dbb3b088c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -v1.8.8-rc1 +v1.8.8 ========== Bug #5196 - Some keys on Korean and Japanese keyboards have the same keycode Bug #5578 - Pressing Hangul key results in alt+'a'