]> source.dussan.org Git - tigervnc.git/commitdiff
Flush pending changes when desktop starts
authorPierre Ossman <ossman@cendio.se>
Mon, 7 May 2018 12:24:56 +0000 (14:24 +0200)
committerPierre Ossman <ossman@cendio.se>
Mon, 7 May 2018 12:24:56 +0000 (14:24 +0200)
The system to avoid processing changes for a stopped desktop was a
bit overly aggressive and resulted in those changes getting stuck even
when the desktop started again (yet another change was needed to get
things rolling again).

Make sure we flush out anything pending once the desktop is back up and
running. We don't use the frame timer here as we no longer know how
old these changes are, so we're not really rate limiting any application.

common/rfb/VNCServerST.cxx

index 95870c9266368ff9b08d952bdc9266162cbffa97..8cc04f740812951bf55b9616502271db8bfb2013 100644 (file)
@@ -316,9 +316,11 @@ void VNCServerST::setPixelBuffer(PixelBuffer* pb_, const ScreenSet& layout)
     return;
   }
 
+  // Assume the framebuffer contents wasn't saved and reset everything
+  // that tracks its contents
   comparer = new ComparingUpdateTracker(pb);
   renderedCursorInvalid = true;
-  startFrameClock();
+  add_changed(pb->getRect());
 
   // Make sure that we have at least one screen
   if (screenLayout.num_screens() == 0)
@@ -539,9 +541,13 @@ void VNCServerST::startDesktop()
   if (!desktopStarted) {
     slog.debug("starting desktop");
     desktop->start(this);
-    desktopStarted = true;
     if (!pb)
       throw Exception("SDesktop::start() did not set a valid PixelBuffer");
+    desktopStarted = true;
+    // The tracker might have accumulated changes whilst we were
+    // stopped, so flush those out
+    if (!comparer->is_empty())
+      writeUpdate();
   }
 }