mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-08 06:31:50 +08:00
Fixed handling of handshake complete. Was posting an event for it
but making direct calls for other messages from the server. This could cause messages to be handled out of order. Now making a direct call for handshake complete.
This commit is contained in:
@@ -111,6 +111,14 @@ CClient::disconnect(const char* msg)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CClient::handshakeComplete()
|
||||
{
|
||||
m_ready = true;
|
||||
m_screen->enable();
|
||||
sendEvent(getConnectedEvent(), NULL);
|
||||
}
|
||||
|
||||
bool
|
||||
CClient::isConnected() const
|
||||
{
|
||||
@@ -386,10 +394,6 @@ CClient::setupScreen()
|
||||
getEventTarget(),
|
||||
new TMethodEventJob<CClient>(this,
|
||||
&CClient::handleClipboardGrabbed));
|
||||
EVENTQUEUE->adoptHandler(CServerProxy::getHandshakeCompleteEvent(),
|
||||
m_server,
|
||||
new TMethodEventJob<CClient>(this,
|
||||
&CClient::handleHandshakeComplete));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -437,11 +441,7 @@ void
|
||||
CClient::cleanupScreen()
|
||||
{
|
||||
if (m_server != NULL) {
|
||||
if (!m_ready) {
|
||||
EVENTQUEUE->removeHandler(CServerProxy::getHandshakeCompleteEvent(),
|
||||
m_server);
|
||||
}
|
||||
else {
|
||||
if (m_ready) {
|
||||
m_screen->disable();
|
||||
m_ready = false;
|
||||
}
|
||||
@@ -523,16 +523,6 @@ CClient::handleDisconnected(const CEvent&, void*)
|
||||
sendEvent(getDisconnectedEvent(), NULL);
|
||||
}
|
||||
|
||||
void
|
||||
CClient::handleHandshakeComplete(const CEvent&, void*)
|
||||
{
|
||||
m_ready = true;
|
||||
EVENTQUEUE->removeHandler(CServerProxy::getHandshakeCompleteEvent(),
|
||||
m_server);
|
||||
sendEvent(getConnectedEvent(), NULL);
|
||||
m_screen->enable();
|
||||
}
|
||||
|
||||
void
|
||||
CClient::handleShapeChanged(const CEvent&, void*)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user