aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/VNCServerST.cxx
diff options
context:
space:
mode:
authorMichal Srb <michalsrb@gmail.com>2017-09-29 14:45:33 +0200
committerPierre Ossman <ossman@cendio.se>2018-03-07 15:28:43 +0100
commit28d570dc910b7a6bbbd246db0ce3713bc2f4491c (patch)
tree684423b0f8ae450af2e3f3ad7d001a9f6a6cdaea /common/rfb/VNCServerST.cxx
parent816baa35ae5374f350ee4031ac54d7d1e90af183 (diff)
downloadtigervnc-28d570dc910b7a6bbbd246db0ce3713bc2f4491c.tar.gz
tigervnc-28d570dc910b7a6bbbd246db0ce3713bc2f4491c.zip
VNCServerST: Allow unsetting pixel buffer.
Originally calling VNCServertST::setPixelBuffer(PixelBuffer* pb_) with pb_=0 would do nothing. With this change pb will be set to 0 and deferred update timer will be stopped.
Diffstat (limited to 'common/rfb/VNCServerST.cxx')
-rw-r--r--common/rfb/VNCServerST.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx
index fc649fa1..0008dc41 100644
--- a/common/rfb/VNCServerST.cxx
+++ b/common/rfb/VNCServerST.cxx
@@ -158,6 +158,7 @@ void VNCServerST::removeSocket(network::Socket* sock) {
slog.debug("no authenticated clients - stopping desktop");
desktopStarted = false;
desktop->stop();
+ stopFrameClock();
}
if (comparer)
@@ -314,8 +315,11 @@ void VNCServerST::setPixelBuffer(PixelBuffer* pb_, const ScreenSet& layout)
screenLayout = layout;
if (!pb) {
+ screenLayout = ScreenSet();
+
if (desktopStarted)
throw Exception("setPixelBuffer: null PixelBuffer when desktopStarted?");
+
return;
}
@@ -338,18 +342,10 @@ void VNCServerST::setPixelBuffer(PixelBuffer* pb_, const ScreenSet& layout)
void VNCServerST::setPixelBuffer(PixelBuffer* pb_)
{
- ScreenSet layout;
-
- if (!pb_) {
- if (desktopStarted)
- throw Exception("setPixelBuffer: null PixelBuffer when desktopStarted?");
- return;
- }
-
- layout = screenLayout;
+ ScreenSet layout = screenLayout;
// Check that the screen layout is still valid
- if (!layout.validate(pb_->width(), pb_->height())) {
+ if (pb_ && !layout.validate(pb_->width(), pb_->height())) {
Rect fbRect;
ScreenSet::iterator iter, iter_next;