summaryrefslogtreecommitdiffstats
path: root/src/server/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
authorManuel Schneider2014-05-27 14:06:49 +0200
committerManuel Schneider2014-05-27 14:06:49 +0200
commit234ec4b758bac2a371a62ee34274e9278fb95511 (patch)
tree2e17e811333e00cc6bee7116acd004f8466d207e /src/server/mainwindow/mainwindow.cpp
parentLock is already handled in onVncServerStateChange. (diff)
downloadpvs2-234ec4b758bac2a371a62ee34274e9278fb95511.tar.gz
pvs2-234ec4b758bac2a371a62ee34274e9278fb95511.tar.xz
pvs2-234ec4b758bac2a371a62ee34274e9278fb95511.zip
Make it possible to exclude a client from multicast.
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r--src/server/mainwindow/mainwindow.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp
index e4958b0..11071f6 100644
--- a/src/server/mainwindow/mainwindow.cpp
+++ b/src/server/mainwindow/mainwindow.cpp
@@ -479,22 +479,24 @@ void MainWindow::multicast(Client *from, Client *to, bool blockOthers)
_mode = blockOthers ? Mode::LockedMulticast : Mode::Multicast;
}
+ // If already watching drop it
+ if (_watchers.contains(to->id()))
+ _watchers.remove(to->id());
+ else // List "to" as watcher
+ _watchers.insert(to->id(), to);
+
// if there is a server running which is not "from" stop it.
if (_streamingSource != NULL && _streamingSource != from)
_streamingSource->stopVncServer();
- _streamingSource = from;
- _watchers.insert(to->id(), to);
+ // Set new streaming source
+ _streamingSource = from;
- if (from->isActiveVncServer()) // From is already active
- this->onVncServerStateChange(from);
+ // If streaming source is already active avoid a restart
+ if (_streamingSource->isActiveVncServer())
+ this->onVncServerStateChange(_streamingSource);
else // Could not take shortcut, (re)start VNC server on source
- from->startVncServer();
-
- if (blockOthers){
- // TODO: REDESIGN TO FIT THE REQUIREMENTS
- }
-
+ _streamingSource->startVncServer();
}
/***************************************************************************//**