: 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() {
calculateFullColourPF();
}
-void
-CConn::paintCompleted() {
- // A repaint message has just completed - request next update if necessary
- requestNewUpdate();
-}
bool
CConn::sysCommand(WPARAM wParam, LPARAM lParam) {
}
+void
+CConn::framebufferUpdateStart() {
+ if (!formatChange) {
+ pendingUpdate = true;
+ requestNewUpdate();
+ } else
+ pendingUpdate = false;
+}
+
+
void
CConn::framebufferUpdateEnd() {
if (debugDelay != 0) {
firstUpdate = false;
}
+ // 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();
if (!requestUpdate) return;
if (formatChange) {
+
+ /* Catch incorrect requestNewUpdate calls */
+ assert(pendingUpdate == false);
+
// Select the required pixel format
if (options.fullColour) {
window->setPF(fullColourPF);
// DesktopWindow::Callback interface
void displayChanged();
- void paintCompleted();
+ void paintCompleted() {}
bool sysCommand(WPARAM wParam, LPARAM lParam);
void closeWindow();
void refreshMenu(bool enableSysCommands);
// 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,
bool reverseConnection;
bool requestUpdate;
bool firstUpdate;
+ bool pendingUpdate;
// Debugging/logging
std::list<Rect> debugRects;