From 28dcd34251429c6e1fe2d1e5848e060d0bada00a Mon Sep 17 00:00:00 2001 From: SerhiiGadzhilov <71632867+SerhiiGadzhilov@users.noreply.github.com> Date: Wed, 4 Aug 2021 17:53:25 +0300 Subject: [PATCH] SYNERGY-1085 Notificatons for unknown applications (#7066) * SYNERGY-1085 Notificatons for unknown applications * Update ChangeLog --- ChangeLog | 2 +- src/lib/client/ServerProxy.cpp | 19 ++++++++++++------- src/lib/server/PrimaryClient.cpp | 19 ++++++++++++------- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 71cd978b1..f410be7d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,7 +12,7 @@ Bug fixes: - #7046 Fix MacOS 10.13 build - #7049 Scroll doesn't work in case of macOS is server - #7057 | #7058 Fix copy paste logic, when OS reported about clipboard update too late -- #7055 Add secure input notification on Linux +- #7055 | #7066 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 diff --git a/src/lib/client/ServerProxy.cpp b/src/lib/client/ServerProxy.cpp index 3d431055b..2cf76e17b 100644 --- a/src/lib/client/ServerProxy.cpp +++ b/src/lib/client/ServerProxy.cpp @@ -919,12 +919,17 @@ ServerProxy::secureInputNotification() String app; ProtocolUtil::readf(m_stream, kMsgDSecureInputNotification + 4, &app); - String secureInputNotificationBody = - "'Secure input' enabled by " + app + " on the server. " \ - "To fix the keyboard, " + app + " must be closed."; - // display this notification on the client - AppUtil::instance().showNotification( - "The keyboard may stop working.", - secureInputNotificationBody); + if (app != "unknown") { + AppUtil::instance().showNotification( + "The keyboard may stop working.", + "'Secure input' enabled by " + app + " on the server. " \ + "To fix the keyboard, " + app + " must be closed."); + } + else { + AppUtil::instance().showNotification( + "The keyboard may stop working.", + "'Secure input' enabled by an application on the server. " \ + "To fix the keyboard, the application must be closed."); + } } diff --git a/src/lib/server/PrimaryClient.cpp b/src/lib/server/PrimaryClient.cpp index 236506069..f4e20ba9a 100644 --- a/src/lib/server/PrimaryClient.cpp +++ b/src/lib/server/PrimaryClient.cpp @@ -270,13 +270,18 @@ PrimaryClient::getSecureInputApp() const void PrimaryClient::secureInputNotification(const String& app) const { - 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); + if (app != "unknown") { + AppUtil::instance().showNotification( + "The client keyboards may stop working.", + "'Secure input' enabled by " + app + ". " \ + "Close " + app + " to continue using keyboards on the clients."); + } + else { + AppUtil::instance().showNotification( + "The client keyboards may stop working.", + "'Secure input' enabled by an application. " \ + "Close the application to continue using keyboards on the clients."); + } } void