From 1c26789eff7b22518fcfb942e3d5a36758fdca19 Mon Sep 17 00:00:00 2001 From: dscho Date: Mon, 19 Dec 2005 19:45:51 +0000 Subject: introduce -deferptrupdate (thanks Dave) --- libvncserver/main.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'libvncserver/main.c') diff --git a/libvncserver/main.c b/libvncserver/main.c index cdf2bfc..41d70ea 100644 --- a/libvncserver/main.c +++ b/libvncserver/main.c @@ -931,6 +931,27 @@ rfbProcessEvents(rfbScreenInfoPtr screen,long usec) } } } + + if (!cl->viewOnly && cl->lastPtrX >= 0) { + if(cl->startPtrDeferring.tv_usec == 0) { + gettimeofday(&cl->startPtrDeferring,NULL); + if(cl->startPtrDeferring.tv_usec == 0) + cl->startPtrDeferring.tv_usec++; + } else { + struct timeval tv; + gettimeofday(&tv,NULL); + if(tv.tv_sec < cl->startPtrDeferring.tv_sec /* at midnight */ + || ((tv.tv_sec-cl->startPtrDeferring.tv_sec)*1000 + +(tv.tv_usec-cl->startPtrDeferring.tv_usec)/1000) + > cl->screen->deferPtrUpdateTime) { + cl->startPtrDeferring.tv_usec = 0; + cl->screen->ptrAddEvent(cl->lastPtrButtons, + cl->lastPtrX, + cl->lastPtrY, cl); + cl->lastPtrX = -1; + } + } + } clPrev=cl; cl=rfbClientIteratorNext(i); if(clPrev->sock==-1) { -- cgit v1.2.1