summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/client/vnc/vncwindow.cpp7
-rw-r--r--src/client/vnc/vncwindow.h1
-rw-r--r--src/server/mainwindow/mainwindow.cpp9
3 files changed, 14 insertions, 3 deletions
diff --git a/src/client/vnc/vncwindow.cpp b/src/client/vnc/vncwindow.cpp
index f55aa28..cf97e74 100644
--- a/src/client/vnc/vncwindow.cpp
+++ b/src/client/vnc/vncwindow.cpp
@@ -118,7 +118,14 @@ void VncWindow::onProjectionStarted()
////////////////////////////////////////////////////////////////////////////////
// Protected
+void VncWindow::close()
+{
+ if (this->isVisible())
+ QDialog::close();
+ else
+ emit running(false, _clientId);
+}
void VncWindow::timerEvent(QTimerEvent *event)
{
if (event->timerId() == _redrawTimer)
diff --git a/src/client/vnc/vncwindow.h b/src/client/vnc/vncwindow.h
index 396e2de..f648ebf 100644
--- a/src/client/vnc/vncwindow.h
+++ b/src/client/vnc/vncwindow.h
@@ -52,6 +52,7 @@ protected:
void resizeEvent(QResizeEvent* event);
void closeEvent(QCloseEvent *e);
void timerEvent(QTimerEvent *event);
+ void close();
//bool event(QEvent *event);
//bool eventFilter(QObject *obj, QEvent *event);
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp
index e3b7952..aeac347 100644
--- a/src/server/mainwindow/mainwindow.cpp
+++ b/src/server/mainwindow/mainwindow.cpp
@@ -599,14 +599,17 @@ void MainWindow::onButtonStopProjection()
c->setDesiredProjectionSource(0);
c->setProjectionSource(false);
}
- NetworkMessage msg;
- msg.setField(_ID, _VNCCLIENT);
+ NetworkMessage stopVncClientmsg;
+ NetworkMessage stopVncServermsg;
+ stopVncClientmsg.setField(_ID, _VNCCLIENT);
+ stopVncServermsg.setField(_ID, _VNCSERVER);
for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it)
{
Client *c = (**it).client();
if (c == NULL)
continue;
- c->sendMessage(msg);
+ c->sendMessage(stopVncClientmsg);
+ c->sendMessage(stopVncServermsg);
}
}