aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/VNCServerST.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2016-12-05 16:58:19 +0100
committerPierre Ossman <ossman@cendio.se>2017-02-24 13:16:42 +0100
commit24684e58f450d2653b1ab400396dbfb3034d90a9 (patch)
tree8d66285900d6e15e758c5cd767baed180dfd59aa /common/rfb/VNCServerST.cxx
parent77ede0a01faa06d9d241da0c62a41d6b388a521c (diff)
downloadtigervnc-24684e58f450d2653b1ab400396dbfb3034d90a9.tar.gz
tigervnc-24684e58f450d2653b1ab400396dbfb3034d90a9.zip
Only update rendered cursor when requested
Diffstat (limited to 'common/rfb/VNCServerST.cxx')
-rw-r--r--common/rfb/VNCServerST.cxx25
1 files changed, 13 insertions, 12 deletions
diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx
index e15cd701..80c79fc3 100644
--- a/common/rfb/VNCServerST.cxx
+++ b/common/rfb/VNCServerST.cxx
@@ -1,5 +1,5 @@
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
- * Copyright 2009-2014 Pierre Ossman for Cendio AB
+ * Copyright 2009-2016 Pierre Ossman for Cendio AB
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -621,12 +621,8 @@ bool VNCServerST::checkUpdate()
Rect clippedCursorRect
= cursor.getRect(cursorPos.subtract(cursor.hotspot)).intersect(pb->getRect());
- if (!renderedCursorInvalid && (toCheck.intersect(clippedCursorRect)
- .is_empty())) {
- renderCursor = false;
- } else {
- toCheck.assign_union(clippedCursorRect);
- }
+ if (!toCheck.intersect(clippedCursorRect).is_empty())
+ renderedCursorInvalid = true;
}
pb->grabRegion(toCheck);
@@ -639,11 +635,6 @@ bool VNCServerST::checkUpdate()
if (comparer->compare())
comparer->getUpdateInfo(&ui, pb->getRect());
- if (renderCursor) {
- renderedCursor.update(pb, &cursor, cursorPos);
- renderedCursorInvalid = false;
- }
-
std::list<VNCSConnectionST*>::iterator ci, ci_next;
for (ci = clients.begin(); ci != clients.end(); ci = ci_next) {
ci_next = ci; ci_next++;
@@ -656,6 +647,16 @@ bool VNCServerST::checkUpdate()
return true;
}
+const RenderedCursor* VNCServerST::getRenderedCursor()
+{
+ if (renderedCursorInvalid) {
+ renderedCursor.update(pb, &cursor, cursorPos);
+ renderedCursorInvalid = false;
+ }
+
+ return &renderedCursor;
+}
+
void VNCServerST::getConnInfo(ListConnInfo * listConn)
{
listConn->Clear();