]> source.dussan.org Git - tigervnc.git/commitdiff
Clean up VNCSConnectionST::needRenderedCursor()
authorPierre Ossman <ossman@cendio.se>
Mon, 5 Dec 2016 15:57:30 +0000 (16:57 +0100)
committerPierre Ossman <ossman@cendio.se>
Fri, 24 Feb 2017 12:15:40 +0000 (13:15 +0100)
Make it a bit more readable.

common/rfb/VNCSConnectionST.cxx

index 6012d74e2934084899540ccff9322dc4d0e69729..64adda1a0e9462fb929e3c77a9ea8cf4fae9c697 100644 (file)
@@ -377,9 +377,16 @@ void VNCSConnectionST::renderedCursorChange()
 
 bool VNCSConnectionST::needRenderedCursor()
 {
-  bool pointerpos = (!server->cursorPos.equals(pointerEventPos) && (time(0) - pointerEventTime) > 0);
-  return (state() == RFBSTATE_NORMAL
-          && ((!cp.supportsLocalCursor && !cp.supportsLocalXCursor) || pointerpos));
+  if (state() != RFBSTATE_NORMAL)
+    return false;
+
+  if (!cp.supportsLocalCursor && !cp.supportsLocalXCursor)
+    return true;
+  if (!server->cursorPos.equals(pointerEventPos) &&
+      (time(0) - pointerEventTime) > 0)
+    return true;
+
+  return false;
 }