From 5ddb06e6b07880a34ca07cbb3c0b220c1b6b6bd1 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 28 Feb 2024 13:54:23 +0100 Subject: Maintain a constant VNCServer/SDesktop connection The desktop isn't completely paused just because there are no clients, so it might still need some support from the server object. This is primarily an issue for headless servers, where they need to continue emulating things even without clients. A scraping server can generally go completely passive if there are no clients. --- win/rfb_win32/SDisplay.cxx | 12 +++++++----- win/rfb_win32/SDisplay.h | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'win') diff --git a/win/rfb_win32/SDisplay.cxx b/win/rfb_win32/SDisplay.cxx index 612f883b..dd1ac7da 100644 --- a/win/rfb_win32/SDisplay.cxx +++ b/win/rfb_win32/SDisplay.cxx @@ -96,7 +96,12 @@ SDisplay::~SDisplay() // -=- SDesktop interface -void SDisplay::start(VNCServer* vs) +void SDisplay::init(VNCServer* vs) +{ + server = vs; +} + +void SDisplay::start() { vlog.debug("starting"); @@ -105,7 +110,6 @@ void SDisplay::start(VNCServer* vs) setConsoleSession(); // Start the SDisplay core - server = vs; startCore(); vlog.debug("started"); @@ -135,10 +139,8 @@ void SDisplay::stop() } // Stop the SDisplayCore - if (server) - server->setPixelBuffer(0); + server->setPixelBuffer(0); stopCore(); - server = 0; vlog.debug("stopped"); diff --git a/win/rfb_win32/SDisplay.h b/win/rfb_win32/SDisplay.h index febc720e..5b55cd66 100644 --- a/win/rfb_win32/SDisplay.h +++ b/win/rfb_win32/SDisplay.h @@ -71,7 +71,8 @@ namespace rfb { // -=- SDesktop interface - virtual void start(VNCServer* vs); + virtual void init(VNCServer* vs); + virtual void start(); virtual void stop(); virtual void terminate(); virtual void queryConnection(network::Socket* sock, -- cgit v1.2.3