From: Christian Authmann <8371862+cauthmann@users.noreply.github.com> Date: Sun, 11 Nov 2018 10:14:40 +0000 (+0100) Subject: Save a few X11 server roundtrips by ignoring empty damage regions. X-Git-Tag: v1.9.90~63 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F763%2Fhead;p=tigervnc.git Save a few X11 server roundtrips by ignoring empty damage regions. Logging revealed that a few empty damage regions are emitted on startup. Those don't need to be rendered to the Surface pixmap. --- diff --git a/vncviewer/PlatformPixelBuffer.cxx b/vncviewer/PlatformPixelBuffer.cxx index be6f7049..1e9803eb 100644 --- a/vncviewer/PlatformPixelBuffer.cxx +++ b/vncviewer/PlatformPixelBuffer.cxx @@ -104,6 +104,9 @@ rfb::Rect PlatformPixelBuffer::getDamage(void) mutex.unlock(); #if !defined(WIN32) && !defined(__APPLE__) + if (r.width() == 0 || r.height() == 0) + return r; + GC gc; gc = XCreateGC(fl_display, pixmap, 0, NULL);