aboutsummaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2024-06-19 16:45:12 +0200
committerPierre Ossman <ossman@cendio.se>2024-06-19 16:45:12 +0200
commit858a859e59dcd794f0e6d50030e183be6ded0f7c (patch)
treed5247bbb8f30932544f86ebbbab9b2161fe4c1b5 /win
parent78510b981b211e29a06a30fa091b08070429b829 (diff)
parent28c3f121613807df6d53dde9ac653916dcf8902d (diff)
downloadtigervnc-858a859e59dcd794f0e6d50030e183be6ded0f7c.tar.gz
tigervnc-858a859e59dcd794f0e6d50030e183be6ded0f7c.zip
Merge branch 'present' of github.com:CendioOssman/tigervnc
Diffstat (limited to 'win')
-rw-r--r--win/rfb_win32/EventManager.cxx6
-rw-r--r--win/rfb_win32/SDisplay.cxx12
-rw-r--r--win/rfb_win32/SDisplay.h3
-rw-r--r--win/rfb_win32/SocketManager.cxx6
4 files changed, 15 insertions, 12 deletions
diff --git a/win/rfb_win32/EventManager.cxx b/win/rfb_win32/EventManager.cxx
index 0f33f5ac..f034d36d 100644
--- a/win/rfb_win32/EventManager.cxx
+++ b/win/rfb_win32/EventManager.cxx
@@ -64,14 +64,14 @@ void EventManager::removeEvent(HANDLE event) {
int EventManager::checkTimeouts() {
- return 0;
+ return -1;
}
BOOL EventManager::getMessage(MSG* msg, HWND hwnd, UINT minMsg, UINT maxMsg) {
while (true) {
// - Process any pending timeouts
- DWORD timeout = checkTimeouts();
- if (timeout == 0)
+ int timeout = checkTimeouts();
+ if (timeout < 0)
timeout = INFINITE;
// - Events take precedence over messages
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,
diff --git a/win/rfb_win32/SocketManager.cxx b/win/rfb_win32/SocketManager.cxx
index 8e88b79b..015ba549 100644
--- a/win/rfb_win32/SocketManager.cxx
+++ b/win/rfb_win32/SocketManager.cxx
@@ -169,9 +169,9 @@ void SocketManager::setDisable(VNCServer* srvr, bool disable)
int SocketManager::checkTimeouts() {
int timeout = EventManager::checkTimeouts();
- std::map<HANDLE,ListenInfo>::iterator i;
- for (i=listeners.begin(); i!=listeners.end(); i++)
- soonestTimeout(&timeout, Timer::checkTimeouts());
+ int nextTimeout = Timer::checkTimeouts();
+ if (nextTimeout >= 0 && nextTimeout < timeout)
+ timeout = nextTimeout;
std::list<network::Socket*> shutdownSocks;
std::map<HANDLE,ConnInfo>::iterator j, j_next;