]> source.dussan.org Git - tigervnc.git/commitdiff
Fix broken logic for sending mouse cursor
authorPierre Ossman <ossman@cendio.se>
Mon, 6 Nov 2017 12:15:55 +0000 (13:15 +0100)
committerPierre Ossman <ossman@cendio.se>
Mon, 6 Nov 2017 12:20:08 +0000 (13:20 +0100)
The logic got inverted resulting in the cursor being sent needlessly
whenever the cursor moved.

common/rfb/VNCSConnectionST.cxx

index d9bb28155255d63413a95ba2603442290f4e064a..9e58657c049cf3e704eb47f50f4b4650cd35ae42 100644 (file)
@@ -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;