summaryrefslogtreecommitdiffstats
path: root/src/server/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r--src/server/mainwindow/mainwindow.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp
index a7648b9..9a28a55 100644
--- a/src/server/mainwindow/mainwindow.cpp
+++ b/src/server/mainwindow/mainwindow.cpp
@@ -1169,15 +1169,17 @@ void MainWindow::onVncServerStateChange(Client* client)
if (client->isActiveVncServer()) {
// apply the desired projection sources
- for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it)
- if ( (*it)->client() != nullptr) { // Ignore offline clients
- if ( (*it)->client()->desiredProjectionSource() == client->id() )
- (*it)->client()->startVncClient(client);
- else
- (*it)->client()->stopVncClient();
-
- (*it)->client()->lockScreen((*it)->client()->desiredProjectionSource() == NO_SOURCE && _mode == Mode::LockedUnicast);
+ for (ConnectionFrame *frame : _clientFrames) {
+ if (frame->client() == nullptr) // Ignore offline clients
+ continue;
+ if (frame->client()->desiredProjectionSource() == client->id()) {
+ frame->client()->startVncClient(client);
+ client->lockScreen(false);
+ }
+ if (frame->client()->desiredProjectionSource() == NO_SOURCE && _mode == Mode::LockedUnicast) {
+ frame->client()->lockScreen(true);
}
+ }
// Dont forget to unlock the vnc server
client->lockScreen(false);
} else {