aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer/PlatformPixelBuffer.cxx
diff options
context:
space:
mode:
authorChristian Authmann <8371862+cauthmann@users.noreply.github.com>2018-11-11 11:14:40 +0100
committerChristian Authmann <8371862+cauthmann@users.noreply.github.com>2018-11-11 11:14:40 +0100
commitccc347d1f49f71d42a5d0834ae9dabe597d20c74 (patch)
tree52e1b3e76c0c6e3007614c82b7a97c8ec35f02ce /vncviewer/PlatformPixelBuffer.cxx
parent82b04eb2754c979506724af5d1f9c5994c5e5654 (diff)
downloadtigervnc-ccc347d1f49f71d42a5d0834ae9dabe597d20c74.tar.gz
tigervnc-ccc347d1f49f71d42a5d0834ae9dabe597d20c74.zip
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.
Diffstat (limited to 'vncviewer/PlatformPixelBuffer.cxx')
-rw-r--r--vncviewer/PlatformPixelBuffer.cxx3
1 files changed, 3 insertions, 0 deletions
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);