diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | libvncclient/rfbproto.c | 5 | ||||
-rw-r--r-- | libvncclient/vncviewer.c | 25 | ||||
-rw-r--r-- | rfb/rfbclient.h | 4 |
4 files changed, 30 insertions, 8 deletions
@@ -1,3 +1,7 @@ +2007-02-01 Johannes E. Schindelin <[email protected]> + * libvncclient: add updateRect member to rfbClient, to allow + requesting smaller updates than whole-screen. + 2007-01-31 Karl Runge <[email protected]> * libvncclient: add GotCursorShape() and GotCopyRect() hooks. fix copyrect code in rfbproto.c, add copyrect to default list. 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; } diff --git a/rfb/rfbclient.h b/rfb/rfbclient.h index 17b22b3..541fee1 100644 --- a/rfb/rfbclient.h +++ b/rfb/rfbclient.h @@ -124,6 +124,10 @@ typedef struct _rfbClient { rfbBool listenSpecified; int listenPort, flashPort; + struct { + int x, y, w, h; + } updateRect; + /* Note that the CoRRE encoding uses this buffer and assumes it is big enough to hold 255 * 255 * 32 bits -> 260100 bytes. 640*480 = 307200 bytes. Hextile also assumes it is big enough to hold 16 * 16 * 32 bits. |