diff options
author | Simon Rettberg | 2018-07-31 15:06:41 +0200 |
---|---|---|
committer | Simon Rettberg | 2018-07-31 15:06:41 +0200 |
commit | c2e9c13b25804ee697bc50c7dfa5d0b810bfc5bf (patch) | |
tree | e85ff1a8aa4feb7983b7de537deae531237aed76 /src/server | |
parent | [*] Convert old C-Style casts (diff) | |
download | pvs2-c2e9c13b25804ee697bc50c7dfa5d0b810bfc5bf.tar.gz pvs2-c2e9c13b25804ee697bc50c7dfa5d0b810bfc5bf.tar.xz pvs2-c2e9c13b25804ee697bc50c7dfa5d0b810bfc5bf.zip |
[SERVER] Fix locking when locked unicast is current mode
Streaming source wasn't locked properly before
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 14 | ||||
-rw-r--r-- | src/server/net/client.cpp | 3 |
2 files changed, 11 insertions, 6 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 73fcbaf..62e15d2 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -599,16 +599,19 @@ void MainWindow::reset(bool lock) { _mode = Mode::None; + // Stop server (Clients get stopped on ACK) + if (getClientFromId(_streamingSource) != nullptr) { + getClientFromId(_streamingSource)->stopVncServer(); + } + // Unlock all clients - for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) + for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) { if ((*it)->client() != nullptr) { (*it)->client()->lockScreen(lock); (*it)->client()->removeAttention(); } + } - // Stop server (Clients get stopped on ACK) - if (getClientFromId(_streamingSource) != nullptr) - getClientFromId(_streamingSource)->stopVncServer(); } /* @@ -1219,7 +1222,8 @@ void MainWindow::onVncServerStateChange(Client* client) } } // Dont forget to unlock the vnc server (if necesarry) - client->lockScreen(client->desiredProjectionSource() == NO_SOURCE && _mode == Mode::LockedUnicast); + client->lockScreen((client->desiredProjectionSource() == NO_SOURCE && _mode == Mode::LockedUnicast) + || ui->action_Lock->isChecked()); // If this was the current source remember that there is no source anymore and reset mode if (client == getClientFromId(_streamingSource)) { diff --git a/src/server/net/client.cpp b/src/server/net/client.cpp index 9b2101f..3920ef7 100644 --- a/src/server/net/client.cpp +++ b/src/server/net/client.cpp @@ -22,7 +22,7 @@ Client::Client(QTcpSocket* socket) : _socket(socket) assert(socket != nullptr); _authed = 0; _projectionSource = 0; - _desiredSource = 0; + _desiredSource = NO_SOURCE; _isActiveVncClient = false; _vncPort = 0; _isTutor = false; @@ -305,6 +305,7 @@ void Client::stopVncClient() msg.setField(_ID, _VNCCLIENT); sendMessage(msg); } + _desiredSource = NO_SOURCE; } /***************************************************************************//** |