summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsr2013-02-05 19:34:13 +0100
committersr2013-02-05 19:34:13 +0100
commite19b548a33e138062c3559a69b7ad35d1f298627 (patch)
treeff3c21a9e9edf15448d3e43c72f127de8ae06dd7 /src
parent... (diff)
downloadpvs2-e19b548a33e138062c3559a69b7ad35d1f298627.tar.gz
pvs2-e19b548a33e138062c3559a69b7ad35d1f298627.tar.xz
pvs2-e19b548a33e138062c3559a69b7ad35d1f298627.zip
...
Diffstat (limited to 'src')
-rw-r--r--src/server/connectionframe/connectionframe.cpp4
-rw-r--r--src/server/connectionframe/connectionframe.h2
-rw-r--r--src/server/mainwindow/mainwindow.cpp8
-rw-r--r--src/server/net/client.cpp6
4 files changed, 13 insertions, 7 deletions
diff --git a/src/server/connectionframe/connectionframe.cpp b/src/server/connectionframe/connectionframe.cpp
index 05e24a4..a05af95 100644
--- a/src/server/connectionframe/connectionframe.cpp
+++ b/src/server/connectionframe/connectionframe.cpp
@@ -100,7 +100,7 @@ void ConnectionFrame::assignClient(Client* client)
connect(client, SIGNAL(disconnected()), this, SLOT(onClientDisconnected()));
connect(client, SIGNAL(thumbUpdated(Client*, const QPixmap&)), this, SLOT(onThumbUpdated(Client*, const QPixmap&)));
connect(client, SIGNAL(vncServerStateChange(Client*)), this, SLOT(onVncServerStateChange(Client*)));
- connect(client, SIGNAL(vncClientStateChange(Client*)), this, SLOT(onVncClientStateChange(Client*)));
+ connect(client, SIGNAL(vncClientStateChange(Client*, ClientId)), this, SLOT(onVncClientStateChange(Client*, ClientId)));
_client = client;
_computerId = client->computerId();
_lblHostName->setText(client->ip());
@@ -280,7 +280,7 @@ void ConnectionFrame::onVncServerStateChange(Client* client)
this->updateColor();
}
-void ConnectionFrame::onVncClientStateChange(Client* client)
+void ConnectionFrame::onVncClientStateChange(Client* client, ClientId lastSource)
{
this->updateColor();
}
diff --git a/src/server/connectionframe/connectionframe.h b/src/server/connectionframe/connectionframe.h
index cc7ab05..ac1a0a8 100644
--- a/src/server/connectionframe/connectionframe.h
+++ b/src/server/connectionframe/connectionframe.h
@@ -71,7 +71,7 @@ private slots:
void onClientDisconnected();
void onThumbUpdated(Client* client, const QPixmap& thumb);
void onVncServerStateChange(Client* client);
- void onVncClientStateChange(Client* client);
+ void onVncClientStateChange(Client* client, ClientId lastSource);
};
#endif
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp
index 6e312e6..ceb445a 100644
--- a/src/server/mainwindow/mainwindow.cpp
+++ b/src/server/mainwindow/mainwindow.cpp
@@ -406,8 +406,12 @@ void MainWindow::prepareForProjection(Client * const from, Client * const to)
// One to one is desired, figure out what to do with current client
- if (to->isActiveVncClient())
- to->stopVncClient();
+ if (to->isActiveVncServer())
+ {
+ if (to->currentProjectionSource() == from->id())
+ return; // Nothing to do
+ to->stopVncServer();
+ }
to->setDesiredProjectionSource(from->id());
if (from->isActiveVncServer())
diff --git a/src/server/net/client.cpp b/src/server/net/client.cpp
index 95139a9..26c1dd2 100644
--- a/src/server/net/client.cpp
+++ b/src/server/net/client.cpp
@@ -203,12 +203,13 @@ void Client::handleMsg()
if (!_activeVncClient && other == 0)
_desiredProjectionSource = 0;
- emit vncClientStateChange(this, _currentProjectionSource);
-
+ ClientId last = _currentProjectionSource;
if (!_activeVncClient)
_currentProjectionSource = 0;
else
_currentProjectionSource = other;
+
+ emit vncClientStateChange(this, last);
}
return;
}
@@ -294,6 +295,7 @@ void Client::stopVncServer()
void Client::stopVncClient()
{
+ _activeVncClient = false;
_toClient.reset();
_toClient.setField(_ID, _VNCCLIENT);
sendMessage(_toClient);