diff options
author | dscho <dscho> | 2002-10-29 14:07:15 +0000 |
---|---|---|
committer | dscho <dscho> | 2002-10-29 14:07:15 +0000 |
commit | 19c7fc0217e2087af2173974689b9b0f892a18d3 (patch) | |
tree | 19d0e028bd9a3ba3bdf55734a7a426a67f16e454 /main.c | |
parent | 347ab48bd94a04b14009f0ac98df5b42d5da11a5 (diff) | |
download | libtdevnc-19c7fc0217e2087af2173974689b9b0f892a18d3.tar.gz libtdevnc-19c7fc0217e2087af2173974689b9b0f892a18d3.zip |
patch from Const for CursorPosUpdate encoding
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 34 |
1 files changed, 25 insertions, 9 deletions
@@ -364,16 +364,32 @@ defaultKbdAddEvent(Bool down, KeySym keySym, rfbClientPtr cl) void defaultPtrAddEvent(int buttonMask, int x, int y, rfbClientPtr cl) { - if(x!=cl->screen->cursorX || y!=cl->screen->cursorY) { - if(cl->screen->cursorIsDrawn) - rfbUndrawCursor(cl->screen); - LOCK(cl->screen->cursorMutex); - if(!cl->screen->cursorIsDrawn) { - cl->screen->cursorX = x; - cl->screen->cursorY = y; + rfbClientIteratorPtr iterator; + rfbClientPtr other_client; + + if (x != cl->screen->cursorX || y != cl->screen->cursorY) { + if (cl->screen->cursorIsDrawn) + rfbUndrawCursor(cl->screen); + LOCK(cl->screen->cursorMutex); + if (!cl->screen->cursorIsDrawn) { + cl->screen->cursorX = x; + cl->screen->cursorY = y; + } + UNLOCK(cl->screen->cursorMutex); + + /* The cursor was moved by this client, so don't send CursorPos. */ + if (cl->enableCursorPosUpdates) + cl->cursorWasMoved = FALSE; + + /* But inform all remaining clients about this cursor movement. */ + iterator = rfbGetClientIterator(cl->screen); + while ((other_client = rfbClientIteratorNext(iterator)) != NULL) { + if (other_client != cl && other_client->enableCursorPosUpdates) { + other_client->cursorWasMoved = TRUE; } - UNLOCK(cl->screen->cursorMutex); - } + } + rfbReleaseClientIterator(iterator); + } } void defaultSetXCutText(char* text, int len, rfbClientPtr cl) |