From 330ca42ef70c38f21ed7b385ae92988f8bbfc5ea Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 6 Nov 2017 13:15:55 +0100 Subject: [PATCH] Fix broken logic for sending mouse cursor The logic got inverted resulting in the cursor being sent needlessly whenever the cursor moved. --- common/rfb/VNCSConnectionST.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/rfb/VNCSConnectionST.cxx b/common/rfb/VNCSConnectionST.cxx index d9bb2815..9e58657c 100644 --- a/common/rfb/VNCSConnectionST.cxx +++ b/common/rfb/VNCSConnectionST.cxx @@ -379,9 +379,10 @@ void VNCSConnectionST::renderedCursorChange() { if (state() != RFBSTATE_NORMAL) return; // Are we switching between client-side and server-side cursor? - if (damagedCursorRegion.is_empty() != needRenderedCursor()) + bool hasRenderedCursor = !damagedCursorRegion.is_empty(); + if (hasRenderedCursor != needRenderedCursor()) setCursorOrClose(); - if (!damagedCursorRegion.is_empty()) + if (hasRenderedCursor) removeRenderedCursor = true; if (needRenderedCursor()) { updateRenderedCursor = true; -- 2.39.5