summaryrefslogtreecommitdiffstats
path: root/libvncclient
diff options
context:
space:
mode:
authordscho <dscho>2007-02-01 15:05:55 +0000
committerdscho <dscho>2007-02-01 15:05:55 +0000
commit14b290384a46c5fd9885a7e34d2855dc823771d3 (patch)
treebdb1afa607402080a5b53d3a369c8b71a19452ae /libvncclient
parent35d481a783474d8b5eab4e9924008414253bbf4c (diff)
downloadlibtdevnc-14b290384a46c5fd9885a7e34d2855dc823771d3.tar.gz
libtdevnc-14b290384a46c5fd9885a7e34d2855dc823771d3.zip
LibVNCClient: some users do not want to get whole-screen updates; introduce client->updateRect for that
Diffstat (limited to 'libvncclient')
-rw-r--r--libvncclient/rfbproto.c5
-rw-r--r--libvncclient/vncviewer.c25
2 files changed, 22 insertions, 8 deletions
diff --git a/libvncclient/rfbproto.c b/libvncclient/rfbproto.c
index 2704dee..01c80ca 100644
--- a/libvncclient/rfbproto.c
+++ b/libvncclient/rfbproto.c
@@ -854,8 +854,9 @@ SetFormatAndEncodings(rfbClient* client)
rfbBool
SendIncrementalFramebufferUpdateRequest(rfbClient* client)
{
- return SendFramebufferUpdateRequest(client, 0, 0, client->width,
- client->height, TRUE);
+ return SendFramebufferUpdateRequest(client,
+ client->updateRect.x, client->updateRect.y,
+ client->updateRect.w, client->updateRect.h, TRUE);
}
diff --git a/libvncclient/vncviewer.c b/libvncclient/vncviewer.c
index 2e42b87..ffb0976 100644
--- a/libvncclient/vncviewer.c
+++ b/libvncclient/vncviewer.c
@@ -119,7 +119,10 @@ rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,
client->CurrentKeyboardLedState = 0;
client->HandleKeyboardLedState = (HandleKeyboardLedStateProc)DummyPoint;
-
+
+ /* default: use complete frame buffer */
+ client->updateRect.x = -1;
+
client->format.bitsPerPixel = bytesPerPixel*8;
client->format.depth = bitsPerSample*samplesPerPixel;
client->appData.requestedDepth=client->format.depth;
@@ -202,20 +205,30 @@ static rfbBool rfbInitConnection(rfbClient* client)
client->height=client->si.framebufferHeight;
client->MallocFrameBuffer(client);
+ if (client->updateRect.x < 0) {
+ client->updateRect.x = client->updateRect.y = 0;
+ client->updateRect.w = client->width;
+ client->updateRect.h = client->height;
+ }
+
if (client->appData.scaleSetting>1)
{
if (!SendScaleSetting(client, client->appData.scaleSetting))
return FALSE;
if (!SendFramebufferUpdateRequest(client,
- 0,0,
- client->width/client->appData.scaleSetting,
- client->height/client->appData.scaleSetting,FALSE))
- return FALSE;
+ client->updateRect.x / client->appData.scaleSetting,
+ client->updateRect.y / client->appData.scaleSetting,
+ client->updateRect.w / client->appData.scaleSetting,
+ client->updateRect.h / client->appData.scaleSetting,
+ FALSE))
+ return FALSE;
}
else
{
if (!SendFramebufferUpdateRequest(client,
- 0,0,client->width,client->height,FALSE))
+ client->updateRect.x, client->updateRect.y,
+ client->updateRect.w, client->updateRect.h,
+ FALSE))
return FALSE;
}