From ccc347d1f49f71d42a5d0834ae9dabe597d20c74 Mon Sep 17 00:00:00 2001 From: Christian Authmann <8371862+cauthmann@users.noreply.github.com> Date: Sun, 11 Nov 2018 11:14:40 +0100 Subject: [PATCH] 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. --- vncviewer/PlatformPixelBuffer.cxx | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.39.5