Commit fefcb918 authored by dscho's avatar dscho

fix cursor trails (when not using cursor encoding and moving the cursor,

the redrawn part of the screen didn't get updated, and so left cursor trails).
parent fc45b97d
2004-06-07 Johannes E. Schindelin <Johannes.Schindelin@gmx.de> 2004-06-07 Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
* libvncserver/cursor.c, rfb/rfb.h: fix cursor trails
* */Makefile.am: stop automake nagging * */Makefile.am: stop automake nagging
* libvncclient/*, client_examples/*: streamline API, SDLvncviewer added * libvncclient/*, client_examples/*: streamline API, SDLvncviewer added
* examples/, libvncclient/, test/: moved tests to test/ * examples/, libvncclient/, test/: moved tests to test/
......
immediate: immediate:
---------- ----------
cursor drawing does not get undone prior to sending
TightVNC encoding!!! Regression!!! TightVNC encoding!!! Regression!!!
extra_bytes in rfbDrawCharWithClip. extra_bytes in rfbDrawCharWithClip.
tested mouse buttons make copy rect, but text is not marked as mod. tested mouse buttons make copy rect, but text is not marked as mod.
...@@ -19,6 +18,7 @@ CORBA ...@@ -19,6 +18,7 @@ CORBA
done: done:
----- -----
.cursor drawing does not get undone prior to sending
.following two items overridden by RealVNC's idea: if there are too many .following two items overridden by RealVNC's idea: if there are too many
rectangles (like >50), just use the bounding box. rectangles (like >50), just use the bounding box.
cursor drawing: set optional grain to mark bigger rectangles as drawn (else cursor drawing: set optional grain to mark bigger rectangles as drawn (else
......
...@@ -390,7 +390,7 @@ void rfbUndrawCursor(rfbScreenInfoPtr s) ...@@ -390,7 +390,7 @@ void rfbUndrawCursor(rfbScreenInfoPtr s)
int j,x1,x2,y1,y2,bpp=s->rfbServerFormat.bitsPerPixel/8, int j,x1,x2,y1,y2,bpp=s->rfbServerFormat.bitsPerPixel/8,
rowstride=s->paddedWidthInBytes; rowstride=s->paddedWidthInBytes;
LOCK(s->cursorMutex); LOCK(s->cursorMutex);
if(!s->cursorIsDrawn) { if(!s->cursorIsDrawn || !c) {
UNLOCK(s->cursorMutex); UNLOCK(s->cursorMutex);
return; return;
} }
...@@ -421,6 +421,8 @@ void rfbUndrawCursor(rfbScreenInfoPtr s) ...@@ -421,6 +421,8 @@ void rfbUndrawCursor(rfbScreenInfoPtr s)
/* rfbMarkRectAsModified(s,x1,y1,x1+x2,y1+y2); */ /* rfbMarkRectAsModified(s,x1,y1,x1+x2,y1+y2); */
s->cursorIsDrawn = FALSE; s->cursorIsDrawn = FALSE;
s->oldCursorX=s->cursorX;
s->oldCursorY=s->cursorY;
UNLOCK(s->cursorMutex); UNLOCK(s->cursorMutex);
} }
...@@ -431,7 +433,7 @@ void rfbDrawCursor(rfbScreenInfoPtr s) ...@@ -431,7 +433,7 @@ void rfbDrawCursor(rfbScreenInfoPtr s)
rowstride=s->paddedWidthInBytes, rowstride=s->paddedWidthInBytes,
bufSize,w; bufSize,w;
rfbBool wasChanged=FALSE; rfbBool wasChanged=FALSE;
if(!c) return; if(!c) return;
LOCK(s->cursorMutex); LOCK(s->cursorMutex);
if(s->cursorIsDrawn) { if(s->cursorIsDrawn) {
...@@ -439,6 +441,13 @@ void rfbDrawCursor(rfbScreenInfoPtr s) ...@@ -439,6 +441,13 @@ void rfbDrawCursor(rfbScreenInfoPtr s)
UNLOCK(s->cursorMutex); UNLOCK(s->cursorMutex);
return; return;
} }
if(s->cursor && s->underCursorBuffer &&
(s->cursorX!=s->oldCursorX || s->cursorY!=s->oldCursorY)) {
int x1=s->oldCursorX-s->cursor->xhot,x2=x1+s->cursor->width;
int y1=s->oldCursorY-s->cursor->yhot,y2=y1+s->cursor->height;
rfbMarkRectAsModified(s,x1,y1,x2,y2);
}
bufSize=c->width*c->height*bpp; bufSize=c->width*c->height*bpp;
w=(c->width+7)/8; w=(c->width+7)/8;
if(s->underCursorBufferLen<bufSize) { if(s->underCursorBufferLen<bufSize) {
...@@ -518,6 +527,9 @@ void rfbSetCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr c,rfbBool freeOld) ...@@ -518,6 +527,9 @@ void rfbSetCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr c,rfbBool freeOld)
LOCK(rfbScreen->cursorMutex); LOCK(rfbScreen->cursorMutex);
} }
free(rfbScreen->underCursorBuffer);
rfbScreen->underCursorBuffer=0;
if(rfbScreen->cursor && (freeOld || rfbScreen->cursor->cleanup)) if(rfbScreen->cursor && (freeOld || rfbScreen->cursor->cleanup))
rfbFreeCursor(rfbScreen->cursor); rfbFreeCursor(rfbScreen->cursor);
......
...@@ -248,7 +248,7 @@ typedef struct _rfbScreenInfo ...@@ -248,7 +248,7 @@ typedef struct _rfbScreenInfo
struct _rfbClientRec* rfbClientHead; struct _rfbClientRec* rfbClientHead;
/* cursor */ /* cursor */
int cursorX, cursorY,underCursorBufferLen; int cursorX, cursorY,oldCursorX,oldCursorY,underCursorBufferLen;
char* underCursorBuffer; char* underCursorBuffer;
rfbBool dontConvertRichCursorToXCursor; rfbBool dontConvertRichCursorToXCursor;
struct rfbCursor* cursor; struct rfbCursor* cursor;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment