diff options
author | Pierre Ossman <ossman@cendio.se> | 2015-09-23 12:18:52 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2015-09-23 12:20:14 +0200 |
commit | d9b9003d977f8aaf37010c70bdac0b827749d554 (patch) | |
tree | e97ee5a9135c25519eafc8f548b5f1cf985c301c /vncviewer | |
parent | e539cb857f36dc0c6ca1f0e4af4d886c93ea1cfe (diff) | |
download | tigervnc-d9b9003d977f8aaf37010c70bdac0b827749d554.tar.gz tigervnc-d9b9003d977f8aaf37010c70bdac0b827749d554.zip |
Display partial updates on slow transfers
Normally we only display screen changes once we have the updates for
the entire screen. This may give the impression that the viewer is
hung though. So display the partial data if the update is taking to
long to arrive.
Diffstat (limited to 'vncviewer')
-rw-r--r-- | vncviewer/CConn.cxx | 16 | ||||
-rw-r--r-- | vncviewer/CConn.h | 2 | ||||
-rw-r--r-- | vncviewer/Viewport.cxx | 1 |
3 files changed, 18 insertions, 1 deletions
diff --git a/vncviewer/CConn.cxx b/vncviewer/CConn.cxx index f8b45af2..2acb373e 100644 --- a/vncviewer/CConn.cxx +++ b/vncviewer/CConn.cxx @@ -133,6 +133,7 @@ CConn::CConn(const char* vncServerName, network::Socket* socket=NULL) CConn::~CConn() { OptionsDialog::removeCallback(handleOptions); + Fl::remove_timeout(handleUpdateTimeout, this); for (size_t i = 0; i < sizeof(decoders)/sizeof(decoders[0]); i++) delete decoders[i]; @@ -344,6 +345,9 @@ void CConn::framebufferUpdateStart() pendingUpdate = false; requestNewUpdate(); + + // Update the screen prematurely for very slow updates + Fl::add_timeout(1.0, handleUpdateTimeout, this); } // framebufferUpdateEnd() is called at the end of an update. @@ -352,6 +356,7 @@ void CConn::framebufferUpdateStart() // appropriately, and then request another incremental update. void CConn::framebufferUpdateEnd() { + Fl::remove_timeout(handleUpdateTimeout, this); desktop->updateWindow(); if (firstUpdate) { @@ -692,3 +697,14 @@ void CConn::handleOptions(void *data) self->requestNewUpdate(); } } + +void CConn::handleUpdateTimeout(void *data) +{ + CConn *self = (CConn *)data; + + assert(self); + + self->desktop->updateWindow(); + + Fl::repeat_timeout(1.0, handleUpdateTimeout, data); +} diff --git a/vncviewer/CConn.h b/vncviewer/CConn.h index 1b929373..06e3040c 100644 --- a/vncviewer/CConn.h +++ b/vncviewer/CConn.h @@ -81,6 +81,8 @@ private: static void handleOptions(void *data); + static void handleUpdateTimeout(void *data); + private: char* serverHost; int serverPort; diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx index 4bd0758f..ee74e9d6 100644 --- a/vncviewer/Viewport.cxx +++ b/vncviewer/Viewport.cxx @@ -170,7 +170,6 @@ const rfb::PixelFormat &Viewport::getPreferredPF() // Copy the areas of the framebuffer that have been changed (damaged) // to the displayed window. -// FIXME: Make sure this gets called on slow updates void Viewport::updateWindow() { |