From 13b358fed1b89a7a7f8c47bc175dcb3ccae1e39b Mon Sep 17 00:00:00 2001 From: dscho Date: Mon, 28 Jul 2003 12:01:07 +0000 Subject: fixed maxRectsPerUpdate with Tight encoding bug; some autoconfing; stderr should not be used in a library (use rfbLog instead) --- rfbserver.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'rfbserver.c') diff --git a/rfbserver.c b/rfbserver.c index 9ab205e..aa4213f 100644 --- a/rfbserver.c +++ b/rfbserver.c @@ -1214,16 +1214,17 @@ rfbSendFramebufferUpdate(cl, givenUpdateRegion) fu->type = rfbFramebufferUpdate; if (nUpdateRegionRects != 0xFFFF) { if(cl->screen->maxRectsPerUpdate>0 + /* Tight encoding counts the rectangles differently */ + && cl->preferredEncoding != rfbEncodingTight && nUpdateRegionRects>cl->screen->maxRectsPerUpdate) { sraRegion* newUpdateRegion = sraRgnBBox(updateRegion); sraRgnDestroy(updateRegion); updateRegion = newUpdateRegion; nUpdateRegionRects = sraRgnCountRects(updateRegion); } - fu->nRects = Swap16IfLE((uint16_t)(sraRgnCountRects(updateCopyRegion) + - nUpdateRegionRects + - !!sendCursorShape + !!sendCursorPos)); + nUpdateRegionRects + + !!sendCursorShape + !!sendCursorPos)); } else { fu->nRects = 0xFFFF; } -- cgit v1.2.3