瀏覽代碼

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.
tags/v1.5.90
Pierre Ossman 8 年之前
父節點
當前提交
d9b9003d97
共有 3 個文件被更改,包括 18 次插入1 次删除
  1. 16
    0
      vncviewer/CConn.cxx
  2. 2
    0
      vncviewer/CConn.h
  3. 0
    1
      vncviewer/Viewport.cxx

+ 16
- 0
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);
}

+ 2
- 0
vncviewer/CConn.h 查看文件

@@ -81,6 +81,8 @@ private:

static void handleOptions(void *data);

static void handleUpdateTimeout(void *data);

private:
char* serverHost;
int serverPort;

+ 0
- 1
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()
{

Loading…
取消
儲存