From c2e9c13b25804ee697bc50c7dfa5d0b810bfc5bf Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 31 Jul 2018 15:06:41 +0200 Subject: [SERVER] Fix locking when locked unicast is current mode Streaming source wasn't locked properly before --- src/server/mainwindow/mainwindow.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/server/mainwindow/mainwindow.cpp') 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::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) + for (QList::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)) { -- cgit v1.2.3-55-g7522