From 1a38713ff8001be4ff295619459fed44fd88e2e7 Mon Sep 17 00:00:00 2001 From: SerhiiGadzhilov <71632867+SerhiiGadzhilov@users.noreply.github.com> Date: Wed, 4 Aug 2021 15:12:01 +0300 Subject: [PATCH] SYNERGY-1089 No notification between clients (#7064) * SYNERGY-1089 There is no notification if user moves pointer between clients * SYNERGY-1089 There is no notification if user moves pointer between 2 clients * Update ChangeLog --- ChangeLog | 1 + src/lib/platform/OSXScreen.mm | 24 +----------------------- src/lib/server/PrimaryClient.cpp | 10 ++++++++-- src/lib/server/Server.cpp | 15 ++++++++++----- 4 files changed, 20 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index 39150aaa0d..71cd978b18 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,7 @@ Bug fixes: - #7055 Add secure input notification on Linux - #7052 Add secure input notification on Windows - #7047 | #7060 Fix prevent sleep option on Mac and Windows +- #7064 There is no secure input notification if user moves pointer between clients Enhancements: - #6998 Remove functionality related to the screen saver synchronisation diff --git a/src/lib/platform/OSXScreen.mm b/src/lib/platform/OSXScreen.mm index b08c6ee66e..e7a7048c78 100644 --- a/src/lib/platform/OSXScreen.mm +++ b/src/lib/platform/OSXScreen.mm @@ -59,7 +59,6 @@ enum { kCarbonLoopWaitTimeout = 10 }; -void createSecureInputNotification(); int getSecureInputEventPID(); String getProcessName(int pid); @@ -875,12 +874,8 @@ OSXScreen::enter() bool OSXScreen::leave() { - if(m_isPrimary && IsSecureEventInputEnabled()) { - createSecureInputNotification(); - } - hideCursor(); - + if (isDraggingStarted()) { String& fileList = getDraggingFilename(); @@ -2152,23 +2147,6 @@ OSXScreen::getSecureInputApp() const return ""; } -void -createSecureInputNotification() -{ - int secureInputProcessPID = getSecureInputEventPID(); - String app = getProcessName(secureInputProcessPID); - if(secureInputProcessPID == 0) app = "unknown"; - - String secureInputNotificationBody = - "'Secure input' enabled by " + app + ". " \ - "Close " + app + " to continue using keyboards on the clients."; - - // display this notification on the server - AppUtil::instance().showNotification( - "The client keyboards may stop working.", - secureInputNotificationBody); -} - int getSecureInputEventPID() { diff --git a/src/lib/server/PrimaryClient.cpp b/src/lib/server/PrimaryClient.cpp index 63d40fe159..236506069c 100644 --- a/src/lib/server/PrimaryClient.cpp +++ b/src/lib/server/PrimaryClient.cpp @@ -21,7 +21,7 @@ #include "synergy/Screen.h" #include "synergy/Clipboard.h" #include "base/Log.h" - +#include "synergy/AppUtil.h" // // PrimaryClient // @@ -270,7 +270,13 @@ PrimaryClient::getSecureInputApp() const void PrimaryClient::secureInputNotification(const String& app) const { - // ignore + String secureInputNotificationBody = + "'Secure input' enabled by " + app + ". " \ + "Close " + app + " to continue using keyboards on the clients."; + + AppUtil::instance().showNotification( + "The client keyboards may stop working.", + secureInputNotificationBody); } void diff --git a/src/lib/server/Server.cpp b/src/lib/server/Server.cpp index aebb82496f..4e0715a87a 100644 --- a/src/lib/server/Server.cpp +++ b/src/lib/server/Server.cpp @@ -511,12 +511,17 @@ Server::switchScreen(BaseClientProxy* dst, } } - + #if defined(__APPLE__) - String secureInputApplication = m_active->getSecureInputApp(); - if (m_active == m_primaryClient && secureInputApplication != "") { - dst->secureInputNotification(secureInputApplication); - } + if (dst != m_primaryClient) { + String secureInputApplication = m_primaryClient->getSecureInputApp(); + if (secureInputApplication != "") { + // display notification on the server + m_primaryClient->secureInputNotification(secureInputApplication); + //display notification on the client + dst->secureInputNotification(secureInputApplication); + } + } #endif // cut over