diff options
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/net/client.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/server/net/client.cpp b/src/server/net/client.cpp index f3cbc0d..047bd05 100644 --- a/src/server/net/client.cpp +++ b/src/server/net/client.cpp @@ -215,16 +215,19 @@ void Client::handleMsg() _activeVncClient = (_fromClient.getFieldString("ENABLED").toInt() != 0); const int other = (int)_fromClient.getFieldString("CLIENTID").toInt(); - int last = (_currentProjectionSource != 0 ? _currentProjectionSource : _desiredProjectionSource); + const int last = _activeVncClient ? _currentProjectionSource : other; if (!_activeVncClient) { + if (other == _desiredProjectionSource) + _desiredProjectionSource = 0; _currentProjectionSource = 0; - _desiredProjectionSource = 0; qDebug() << "Client " << _name << " stopped its VNC client (watched " << last << ")"; } else { + if (other == _desiredProjectionSource) + _desiredProjectionSource = 0; _currentProjectionSource = other; qDebug() << "Client " << _name << " started its VNC client (watching " << other << ")"; } @@ -334,7 +337,10 @@ void Client::disconnect() { if (_timerDelete == 0) { + // Order of the follwing 3 is important emit disconnected(); + emit vncClientStateChange(this, _currentProjectionSource); + emit vncServerStateChange(this); _timerDelete = startTimer(500); qDebug("*** Client %s disconnected.", qPrintable(_ip)); _socket->blockSignals(true); |
