last_warp = now;
static void cursor_pos_updates(int x, int y) {	rfbClientIteratorPtr iter;	rfbClientPtr cl;	static time_t last_warp = 0;	int cnt = 0;	if (! cursor_pos) {		return;	}	/* x and y are current positions of X11 pointer on the X11 display */	if (x == screen->cursorX && y == screen->cursorY) {		return;	}	if (screen->cursorIsDrawn) {		rfbUndrawCursor(screen);	}	LOCK(screen->cursorMutex);	if (! screen->cursorIsDrawn) {		screen->cursorX = x;		screen->cursorY = y;	}	UNLOCK(screen->cursorMutex);	iter = rfbGetClientIterator(screen);	while( (cl = rfbClientIteratorNext(iter)) ) {		if (! cl->enableCursorPosUpdates) {			continue;		}		if (cl == last_pointer_client) {			time_t now = time(0);			/*			 * special case if this client was the last one to			 * send a pointer position.			 */			if (x == cursor_x && y == cursor_y && now>last_warp+5) {				cl->cursorWasMoved = FALSE;			} else {				/* an X11 app evidently warped the pointer */				if (debug_pointer) {					rfbLog("cursor_pos_updates: warp "					    "detected dx=%3d dy=%3d\n",					    cursor_x - x, cursor_y - y);				}				cl->cursorWasMoved = TRUE;				last_warp = now;				cnt++;			}		} else {			cl->cursorWasMoved = TRUE;			cnt++;		}	}	rfbReleaseClientIterator(iter);	if (debug_pointer && cnt) {		rfbLog("cursor_pos_updates: sent position x=%3d y=%3d to %d"		    " clients\n", x, y, cnt);	}}