diff options
author | Manuel Schneider | 2014-04-23 18:04:42 +0200 |
---|---|---|
committer | Manuel Schneider | 2014-04-23 18:04:42 +0200 |
commit | bc83b49dc11afffeb2e3267b756fe91bb195f023 (patch) | |
tree | 21f5f5d19892b02c21d92f60f2b5ea16510106fa /src/server/mainwindow/mainwindow.cpp | |
parent | Fixed, that inactive Client can be manually choosen as Tutor. (diff) | |
download | pvs2-bc83b49dc11afffeb2e3267b756fe91bb195f023.tar.gz pvs2-bc83b49dc11afffeb2e3267b756fe91bb195f023.tar.xz pvs2-bc83b49dc11afffeb2e3267b756fe91bb195f023.zip |
[SERVER] Fixed tracking of which clients is watching (trying to watch) which
other client
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index e3b7952..7543004 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -398,6 +398,15 @@ void MainWindow::prepareForProjection(Client * const from, Client * const to) qDebug("One to many requested..."); from->setProjectionSource(true); + // Set desired projection source on all clients + for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) + { + Client *c = (**it).client(); + if (c == NULL || c->id() == from->id()) + continue; // Self or offline + c->setDesiredProjectionSource(from->id()); + } + if (from->isActiveVncServer()) { // From is already active, if there is at least one active client, assume it is not @@ -407,9 +416,9 @@ void MainWindow::prepareForProjection(Client * const from, Client * const to) { Client *c = (**it).client(); if (c == NULL || c->id() == from->id()) - continue; + continue; // Self or offline if (c->currentProjectionSource() != from->id()) - continue; + continue; // Other client // Yep :-) qDebug("Reusing because of active client"); this->onVncServerStateChange(from); @@ -793,8 +802,10 @@ void MainWindow::onClientAuthenticated(Client* client) msg.setField("HOST", c->ip()); msg.setField("PORT", QString::number(c->vncPort())); msg.setField("ROPASS", c->vncRoPass()); + msg.setField("CLIENTID", QString::number(c->id())); msg.setField("CAPTION", c->name() + " @ " + c->host()); client->sendMessage(msg); + client->setDesiredProjectionSource(c->id()); break; } } |