diff options
author | Adam Tkac <atkac@redhat.com> | 2011-04-27 11:20:18 +0000 |
---|---|---|
committer | Adam Tkac <atkac@redhat.com> | 2011-04-27 11:20:18 +0000 |
commit | f586b840bf71f08b900cd3475382a2a5c6d47156 (patch) | |
tree | 0900de241cbb126032301bd2368be595faa43311 /win | |
parent | ed2ab6d8660f23835682499c7edb91eefe451f34 (diff) | |
download | tigervnc-f586b840bf71f08b900cd3475382a2a5c6d47156.tar.gz tigervnc-f586b840bf71f08b900cd3475382a2a5c6d47156.zip |
Merged r4342 - r4359 from 1_1 branch.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4383 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'win')
-rw-r--r-- | win/installer/CMakeLists.txt | 4 | ||||
-rw-r--r-- | win/vncviewer/CConn.cxx | 41 | ||||
-rw-r--r-- | win/vncviewer/CConn.h | 5 | ||||
-rw-r--r-- | win/vncviewer/DesktopWindow.cxx | 3 |
4 files changed, 33 insertions, 20 deletions
diff --git a/win/installer/CMakeLists.txt b/win/installer/CMakeLists.txt index 91781303..56f52a21 100644 --- a/win/installer/CMakeLists.txt +++ b/win/installer/CMakeLists.txt @@ -21,8 +21,8 @@ if(BUILD_WINVNC) set(INST_DEPS ${INST_DEPS} winvnc4 wm_hooks vncconfig) endif() -if(GNUTLS_FOUND AND NOT GNUTLS_STATIC) - set(INST_DEFS ${INST_DEFS}) +if(GNUTLS_FOUND) + set(INST_DEFS ${INST_DEFS} -DHAVE_GNUTLS) endif() configure_file(tigervnc.iss.in tigervnc.iss) diff --git a/win/vncviewer/CConn.cxx b/win/vncviewer/CConn.cxx index 3585966e..b067134a 100644 --- a/win/vncviewer/CConn.cxx +++ b/win/vncviewer/CConn.cxx @@ -80,7 +80,7 @@ CConn::CConn() : window(0), sameMachine(false), encodingChange(false), formatChange(false), lastUsedEncoding_(encodingRaw), sock(0), sockEvent(CreateEvent(0, TRUE, FALSE, 0)), reverseConnection(false), requestUpdate(false), firstUpdate(true), - isClosed_(false) { + pendingUpdate(false), isClosed_(false) { } CConn::~CConn() { @@ -184,11 +184,6 @@ CConn::displayChanged() { calculateFullColourPF(); } -void -CConn::paintCompleted() { - // A repaint message has just completed - request next update if necessary - requestNewUpdate(); -} bool CConn::sysCommand(WPARAM wParam, LPARAM lParam) { @@ -362,10 +357,7 @@ CConn::blockCallback() { // Wait for socket data, or a message to process DWORD result = MsgWaitForMultipleObjects(1, &sockEvent.h, FALSE, INFINITE, QS_ALLINPUT); - if (result == WAIT_OBJECT_0) { - // - Network event notification. Return control to I/O routine. - break; - } else if (result == WAIT_FAILED) { + if (result == WAIT_FAILED) { // - The wait operation failed - raise an exception throw rdr::SystemException("blockCallback wait error", GetLastError()); } @@ -380,6 +372,10 @@ CConn::blockCallback() { // ToAscii() internally). DispatchMessage(&msg); } + + if (result == WAIT_OBJECT_0) + // - Network event notification. Return control to I/O routine. + break; } // Before we return control to the InStream, reset the network event @@ -522,6 +518,16 @@ CConn::showOptionsDialog() { void +CConn::framebufferUpdateStart() { + if (!formatChange) { + requestUpdate = pendingUpdate = true; + requestNewUpdate(); + } else + pendingUpdate = false; +} + + +void CConn::framebufferUpdateEnd() { if (debugDelay != 0) { vlog.debug("debug delay %d",(int)debugDelay); @@ -571,12 +577,17 @@ CConn::framebufferUpdateEnd() { firstUpdate = false; } - if (options.autoSelect) - autoSelectFormatAndEncoding(); - // Always request the next update requestUpdate = true; + // A format change prevented us from sending this before the update, + // so make sure to send it now. + if (formatChange && !pendingUpdate) + requestNewUpdate(); + + if (options.autoSelect) + autoSelectFormatAndEncoding(); + // Check that at least part of the window has changed if (!GetUpdateRect(window->getHandle(), 0, FALSE)) { if (!(GetWindowLong(window->getHandle(), GWL_STYLE) & WS_MINIMIZE)) @@ -662,6 +673,10 @@ CConn::requestNewUpdate() { if (!requestUpdate) return; if (formatChange) { + + /* Catch incorrect requestNewUpdate calls */ + assert(pendingUpdate == false); + // Select the required pixel format if (options.fullColour) { window->setPF(fullColourPF); diff --git a/win/vncviewer/CConn.h b/win/vncviewer/CConn.h index 62b131e1..d3b3b206 100644 --- a/win/vncviewer/CConn.h +++ b/win/vncviewer/CConn.h @@ -93,7 +93,7 @@ namespace rfb { // DesktopWindow::Callback interface void displayChanged(); - void paintCompleted(); + void paintCompleted() {} bool sysCommand(WPARAM wParam, LPARAM lParam); void closeWindow(); void refreshMenu(bool enableSysCommands); @@ -101,7 +101,7 @@ namespace rfb { // CConnection interface void setColourMapEntries(int firstColour, int nColours, rdr::U16* rgbs); void bell(); - void framebufferUpdateStart() {} + void framebufferUpdateStart(); void framebufferUpdateEnd(); void setDesktopSize(int w, int h); void setExtendedDesktopSize(int reason, int result, int w, int h, @@ -152,6 +152,7 @@ namespace rfb { bool reverseConnection; bool requestUpdate; bool firstUpdate; + bool pendingUpdate; // Debugging/logging std::list<Rect> debugRects; diff --git a/win/vncviewer/DesktopWindow.cxx b/win/vncviewer/DesktopWindow.cxx index d60ff8fe..f55eb72e 100644 --- a/win/vncviewer/DesktopWindow.cxx +++ b/win/vncviewer/DesktopWindow.cxx @@ -725,9 +725,6 @@ DesktopWindow::processFrameMessage(UINT msg, WPARAM wParam, LPARAM lParam) { } EndPaint(frameHandle, &ps); - - // - Notify the callback that a paint message has finished processing - callback->paintCompleted(); } return 0; |