From: Pierre Ossman Date: Mon, 5 Dec 2016 15:57:30 +0000 (+0100) Subject: Clean up VNCSConnectionST::needRenderedCursor() X-Git-Tag: v1.7.90~18^2~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=77ede0a01faa06d9d241da0c62a41d6b388a521c;p=tigervnc.git Clean up VNCSConnectionST::needRenderedCursor() Make it a bit more readable. --- 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; }