summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authordscho <dscho>2001-10-05 21:41:16 +0000
committerdscho <dscho>2001-10-05 21:41:16 +0000
commit018e90db5918a75ceaf3835be084e2387f31a47e (patch)
tree88208ae81ee1c6531f054dfc55c477928babec21 /main.c
parent8f407f8a1ab2adf08c438f40cd797fef8a810dae (diff)
downloadlibtdevnc-018e90db5918a75ceaf3835be084e2387f31a47e.tar.gz
libtdevnc-018e90db5918a75ceaf3835be084e2387f31a47e.zip
changed cursor functions to use screen info, not cursor
fixed copy rect.
Diffstat (limited to 'main.c')
-rw-r--r--main.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/main.c b/main.c
index 372bdb9..305645e 100644
--- a/main.c
+++ b/main.c
@@ -67,23 +67,29 @@ void rfbScheduleCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,in
rfbClientIteratorPtr iterator;
rfbClientPtr cl;
- iterator=rfbGetClientIterator(rfbScreen);
+ rfbUndrawCursor(rfbScreen);
+
+ iterator=rfbGetClientIterator(rfbScreen);
while((cl=rfbClientIteratorNext(iterator))) {
LOCK(cl->updateMutex);
if(cl->useCopyRect) {
- while(!sraRgnEmpty(cl->copyRegion) && (cl->copyDX!=dx || cl->copyDY!=dy)) {
-#ifdef HAVE_PTHREADS
- if(cl->screen->backgroundLoop) {
- SIGNAL(cl->updateCond);
- UNLOCK(cl->updateMutex);
- LOCK(cl->updateMutex);
- } else
-#endif
- rfbSendFramebufferUpdate(cl,cl->copyRegion);
- }
sraRgnOr(cl->copyRegion,copyRegion);
cl->copyDX = dx;
cl->copyDY = dy;
+
+#ifdef HAVE_PTHREADS
+ if(cl->screen->backgroundLoop) {
+ SIGNAL(cl->updateCond);
+ UNLOCK(cl->updateMutex);
+ LOCK(cl->updateMutex);
+ } else
+#endif
+ {
+ sraRegionPtr updateRegion = sraRgnCreateRgn(cl->modifiedRegion);
+ sraRgnOr(updateRegion,cl->copyRegion);
+ rfbSendFramebufferUpdate(cl,updateRegion);
+ sraRgnDestroy(updateRegion);
+ }
} else {
sraRgnOr(cl->modifiedRegion,copyRegion);
}
@@ -332,7 +338,7 @@ defaultPtrAddEvent(int buttonMask, int x, int y, rfbClientPtr cl)
{
if(x!=cl->screen->cursorX || y!=cl->screen->cursorY) {
if(cl->screen->cursorIsDrawn)
- rfbUndrawCursor(cl);
+ rfbUndrawCursor(cl->screen);
LOCK(cl->screen->cursorMutex);
if(!cl->screen->cursorIsDrawn) {
cl->screen->cursorX = x;