summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authordscho <dscho>2002-10-29 14:07:15 +0000
committerdscho <dscho>2002-10-29 14:07:15 +0000
commit19c7fc0217e2087af2173974689b9b0f892a18d3 (patch)
tree19d0e028bd9a3ba3bdf55734a7a426a67f16e454 /main.c
parent347ab48bd94a04b14009f0ac98df5b42d5da11a5 (diff)
downloadlibtdevnc-19c7fc02.tar.gz
libtdevnc-19c7fc02.zip
patch from Const for CursorPosUpdate encoding
Diffstat (limited to 'main.c')
-rw-r--r--main.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/main.c b/main.c
index 044e3c6..0f4bf7d 100644
--- a/main.c
+++ b/main.c
@@ -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)