From 77ede0a01faa06d9d241da0c62a41d6b388a521c Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 5 Dec 2016 16:57:30 +0100 Subject: [PATCH] Clean up VNCSConnectionST::needRenderedCursor() Make it a bit more readable. --- common/rfb/VNCSConnectionST.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/common/rfb/VNCSConnectionST.cxx b/common/rfb/VNCSConnectionST.cxx index 6012d74e..64adda1a 100644 --- a/common/rfb/VNCSConnectionST.cxx +++ b/common/rfb/VNCSConnectionST.cxx @@ -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; } -- 2.39.5