summaryrefslogtreecommitdiffstats
path: root/libvncserver/rfbserver.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvncserver/rfbserver.c')
-rw-r--r--libvncserver/rfbserver.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c
index 2b61375..e60aadc 100644
--- a/libvncserver/rfbserver.c
+++ b/libvncserver/rfbserver.c
@@ -353,6 +353,8 @@ rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen,
cl->extensions = NULL;
+ cl->lastPtrX = -1;
+
sprintf(pv,rfbProtocolVersionFormat,rfbProtocolMajorVersion,
rfbProtocolMinorVersion);
@@ -1071,11 +1073,19 @@ rfbProcessClientNormalMessage(rfbClientPtr cl)
cl->screen->pointerClient = cl;
if(!cl->viewOnly) {
- cl->screen->ptrAddEvent(msg.pe.buttonMask,
- Swap16IfLE(msg.pe.x), Swap16IfLE(msg.pe.y), cl);
- }
+ if (msg.pe.buttonMask != cl->lastPtrButtons ||
+ cl->screen->deferPtrUpdateTime == 0) {
+ cl->screen->ptrAddEvent(msg.pe.buttonMask,
+ Swap16IfLE(msg.pe.x), Swap16IfLE(msg.pe.y), cl);
+ cl->lastPtrButtons = msg.pe.buttonMask;
+ } else {
+ cl->lastPtrX = Swap16IfLE(msg.pe.x);
+ cl->lastPtrY = Swap16IfLE(msg.pe.y);
+ cl->lastPtrButtons = msg.pe.buttonMask;
+ }
+ }
+ return;
- return;
case rfbClientCutText: