forked from deskflow/deskflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Synergy 1298 client can't connect to previous server version (deskflo…
…w#7112) * SYNERGY-1298 Remove language from hello message * SYNERGY-1298 Client compatibility * SYNERGY-1298 Compatibility for keydown * SYNERGY-1298 Client part for keydown campatibility * SYNERGY-1298 Move lang checking to handshake stage * Update ChangeLog * SYNERGY-1298 Fix code smell
- Loading branch information
1 parent
940e2ec
commit d92f01f
Showing
15 changed files
with
273 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* synergy -- mouse and keyboard sharing utility | ||
* Copyright (C) 2015-2021 Symless Ltd. | ||
* | ||
* 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 <http://www.gnu.org/licenses/>. | ||
*/ | ||
#include "base/Log.h" | ||
#include "synergy/ProtocolUtil.h" | ||
#include "synergy/languages/LanguageManager.h" | ||
|
||
#include "ClientProxy1_8.h" | ||
|
||
|
||
ClientProxy1_8::ClientProxy1_8(const String& name, synergy::IStream* adoptedStream, Server* server, IEventQueue* events) : | ||
ClientProxy1_7(name, adoptedStream, server, events) | ||
{ | ||
synchronizeLanguages(); | ||
} | ||
|
||
void ClientProxy1_8::synchronizeLanguages() const | ||
{ | ||
synergy::languages::LanguageManager languageManager; | ||
auto localLanguages = languageManager.getSerializedLocalLanguages(); | ||
if (!localLanguages.empty()) { | ||
LOG((CLOG_DEBUG1 "send server languages to the client: %s", localLanguages.c_str())); | ||
ProtocolUtil::writef(getStream(), kMsgDLanguageSynchronisation, &localLanguages); | ||
} | ||
else { | ||
LOG((CLOG_ERR "Fail to read server languages")); | ||
} | ||
} | ||
|
||
void | ||
ClientProxy1_8::keyDown(KeyID key, KeyModifierMask mask, KeyButton button, const String& language) | ||
{ | ||
LOG((CLOG_DEBUG1 "send key down to \"%s\" id=%d, mask=0x%04x, button=0x%04x, language=%s", getName().c_str(), key, mask, button, language.c_str())); | ||
ProtocolUtil::writef(getStream(), kMsgDKeyDownLang, key, mask, button, &language); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* synergy -- mouse and keyboard sharing utility | ||
* Copyright (C) 2015-2021 Symless Ltd. | ||
* | ||
* 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 <http://www.gnu.org/licenses/>. | ||
*/ | ||
#ifndef SERVER_CLIENTPROXY1_8_H | ||
#define SERVER_CLIENTPROXY1_8_H | ||
|
||
#include "server/ClientProxy1_7.h" | ||
|
||
class ClientProxy1_8 : public ClientProxy1_7 | ||
{ | ||
public: | ||
ClientProxy1_8(const String& name, synergy::IStream* adoptedStream, Server* server, IEventQueue* events); | ||
~ClientProxy1_8() override = default; | ||
|
||
void keyDown(KeyID, KeyModifierMask, KeyButton, const String&) override; | ||
|
||
private: | ||
void synchronizeLanguages() const; | ||
|
||
}; | ||
|
||
#endif // SERVER_CLIENTPROXY1_8_H |
Oops, something went wrong.