diff options
Diffstat (limited to 'src/client/vnc')
-rw-r--r-- | src/client/vnc/vncwindow.cpp | 15 | ||||
-rw-r--r-- | src/client/vnc/vncwindow.h | 2 |
2 files changed, 16 insertions, 1 deletions
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) diff --git a/src/client/vnc/vncwindow.h b/src/client/vnc/vncwindow.h index 3a73a8e..396e2de 100644 --- a/src/client/vnc/vncwindow.h +++ b/src/client/vnc/vncwindow.h @@ -51,6 +51,7 @@ protected: void paintEvent(QPaintEvent *event); void resizeEvent(QResizeEvent* event); void closeEvent(QCloseEvent *e); + void timerEvent(QTimerEvent *event); //bool event(QEvent *event); //bool eventFilter(QObject *obj, QEvent *event); @@ -60,6 +61,7 @@ private: int _buttonMask; QMap<unsigned int, bool> _modkeys; int _clientId; + int _redrawTimer; bool eventFilter(QObject *obj, QEvent *event); void keyPressEvent(QKeyEvent* event); |