From 49f3903f316ab7363b4543615d3231e1407a67ab Mon Sep 17 00:00:00 2001 From: sr Date: Wed, 6 Feb 2013 19:21:04 +0100 Subject: [SERVER] Add "stop projection" button [SERVER] Don't show error message when VNC server stops as expected [SERVER/CLIENT] Implement connection timeout of 15 seconds --- src/client/vnc/vncwindow.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/client/vnc/vncwindow.cpp') diff --git a/src/client/vnc/vncwindow.cpp b/src/client/vnc/vncwindow.cpp index d4f6d40..aea2362 100644 --- a/src/client/vnc/vncwindow.cpp +++ b/src/client/vnc/vncwindow.cpp @@ -19,7 +19,7 @@ #include "vncthread.h" VncWindow::VncWindow(QWidget *parent) : - QDialog(parent), _vncWorker(NULL), _viewOnly(true), _buttonMask(0), _clientId(0) + QDialog(parent), _vncWorker(NULL), _viewOnly(true), _buttonMask(0), _clientId(0), _redrawTimer(0) { // } @@ -108,11 +108,23 @@ void VncWindow::onThreadFinished() void VncWindow::onProjectionStarted() { emit running(true, _clientId); + _redrawTimer = startTimer(200); } //////////////////////////////////////////////////////////////////////////////// // Protected +void VncWindow::timerEvent(QTimerEvent *event) +{ + killTimer(event->timerId()); + if (event->timerId() == _redrawTimer) + { + _redrawTimer = 0; + if (this->isVisible()) + this->repaint(); + } +} + void VncWindow::paintEvent(QPaintEvent *event) { const QRect &r = event->rect(); @@ -123,6 +135,7 @@ void VncWindow::paintEvent(QPaintEvent *event) void VncWindow::resizeEvent(QResizeEvent* event) { _vncWorker->setTargetSize(event->size()); + this->repaint(); } void VncWindow::draw(const int x, const int y, const int w, const int h) -- cgit v1.2.3-55-g7522