[Bugfix] Fixed a problem with overloading x0vncserver by update requests, when video area is selected.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2742 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/VNCSConnectionST.cxx b/common/rfb/VNCSConnectionST.cxx
index 024be01..84da709 100644
--- a/common/rfb/VNCSConnectionST.cxx
+++ b/common/rfb/VNCSConnectionST.cxx
@@ -127,6 +127,17 @@
processMsg();
}
+ // If there were update requests, try to send a framebuffer update.
+ // We don't send updates immediately on requests for two reasons:
+ // (1) If a video area is set, we don't want to send it on every
+ // update request. We should gobble all the pending update
+ // requests and send just one update.
+ // (2) This way, we give higher priority to user actions such as
+ // keyboard and pointer events.
+ if (!requested.is_empty()) {
+ writeFramebufferUpdate();
+ }
+
if (!clientsReadyBefore && !requested.is_empty())
server->desktop->framebufferUpdateRequest();
} catch (rdr::EndOfStream&) {
@@ -469,6 +480,8 @@
SConnection::framebufferUpdateRequest(r, incremental);
+ // Just update the requested region.
+ // Framebuffer update will be sent a bit later, see processMessages().
Region reqRgn(r);
requested.assign_union(reqRgn);
@@ -477,8 +490,6 @@
updates.add_changed(reqRgn);
server->comparer->add_changed(reqRgn);
}
-
- writeFramebufferUpdate();
}
void VNCSConnectionST::setVideoRectangle(const Rect& r)