Stop using CopyRect in WinVNC
It cannot keep itself in sync with the actual screen contents well
enough for CopyRect to work accurately. Graphical glitches could
be seen in some cases.
diff --git a/win/rfb_win32/WMWindowCopyRect.cxx b/win/rfb_win32/WMWindowCopyRect.cxx
index 63c1da2..6ca8c35 100644
--- a/win/rfb_win32/WMWindowCopyRect.cxx
+++ b/win/rfb_win32/WMWindowCopyRect.cxx
@@ -42,11 +42,11 @@
Rect winrect(wrect.left, wrect.top, wrect.right, wrect.bottom);
if (fg_window == window) {
if (!fg_window_rect.tl.equals(winrect.tl) && ut) {
- // Window has moved - send a copyrect event to the client
- Point delta = Point(winrect.tl.x-fg_window_rect.tl.x, winrect.tl.y-fg_window_rect.tl.y);
- Region copy_dest = winrect;
- ut->add_copied(copy_dest, delta);
- ut->add_changed(Region(fg_window_rect).subtract(copy_dest));
+ // Window has moved - mark both the previous and new position as changed
+ // (we can't use add_copied() here because we aren't that properly synced
+ // with the actual state of the framebuffer)
+ ut->add_changed(Region(winrect));
+ ut->add_changed(Region(fg_window_rect));
}
}
fg_window = window;