struct UpdateInfo { RectVector cached; RectVector copied; Point copy_delta; RectVector changed; }; unsigned long updates_sent; // A global variable, seems strange. // Thread entry function. vncClientUpdateThread::run_undetached() { SimpleUpdateTracker update; // Will be send to client later. updates_sent = 0; while(1) { if(updates_sent < 1) { while( active and ( not enable || ( A long enough condition) ) ) { // Issue the synchronisation signal, to tell other threads where we have got to m_sync_sig->broadcast(); // Wait to be kicked into action m_signal->wait(); } } else{ // Block. Same as the block before. } // If needs a new scale, send a resize message to client first. // clipregion = m_client->m_incr_rgn; m_client->m_update_tracker.flush_update(update, clipregion); // Add mouse postion to the SimpleUpdateTracker if needed. // update.add_changed(m_client->m_oldmousepos); // If clipboard needed, send rfbServerCutTextMsg. m_client->SendUpdate(update); updates_sent++; } } vncClient::SendUpdate(rfb::SimpleUpdateTracker &update) { // Get the update info from the tracker // update -> rfb::UpdateInfo update_info rfb::UpdateInfo update.get_update(update_info); update.get_update(update_info); //We first make sure the new size is send to the client // Get update rects. // Send rfbFramebufferUpdateMsg (nrects) }