From cf647a33718f5dfffb4f4df3a7ae4235e83a4065 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 24 Nov 2017 12:34:28 +0100 Subject: 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. --- win/rfb_win32/WMWindowCopyRect.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'win/rfb_win32/WMWindowCopyRect.cxx') diff --git a/win/rfb_win32/WMWindowCopyRect.cxx b/win/rfb_win32/WMWindowCopyRect.cxx index 63c1da2e..6ca8c353 100644 --- a/win/rfb_win32/WMWindowCopyRect.cxx +++ b/win/rfb_win32/WMWindowCopyRect.cxx @@ -42,11 +42,11 @@ rfb::win32::WMCopyRect::processEvent() { 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; -- cgit v1.2.3