diff options
author | Pierre Ossman <ossman@cendio.se> | 2017-04-28 10:20:29 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2017-04-28 11:43:24 +0200 |
commit | 0630434292b19898e6bd66e46cc4c6a641efdfe5 (patch) | |
tree | c1a73e5b1eb0948ff5486680a27e8962245a6d24 /vncviewer/DesktopWindow.cxx | |
parent | eefa6fe6e79a0669382878d85cfd767ee9ce2bdc (diff) | |
download | tigervnc-0630434292b19898e6bd66e46cc4c6a641efdfe5.tar.gz tigervnc-0630434292b19898e6bd66e46cc4c6a641efdfe5.zip |
Only draw overlays when needed
Some backends don't like empty draw operations, so have an early check.
Diffstat (limited to 'vncviewer/DesktopWindow.cxx')
-rw-r--r-- | vncviewer/DesktopWindow.cxx | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx index 7941c683..47fe8f89 100644 --- a/vncviewer/DesktopWindow.cxx +++ b/vncviewer/DesktopWindow.cxx @@ -347,10 +347,12 @@ void DesktopWindow::draw() fl_clip_box(ox, oy, ow, oh, ox, oy, ow, oh); - if (offscreen) - statsGraph->blend(offscreen, ox - X, oy - Y, ox, oy, ow, oh, 204); - else - statsGraph->blend(ox - X, oy - Y, ox, oy, ow, oh, 204); + if ((ow != 0) && (oh != 0)) { + if (offscreen) + statsGraph->blend(offscreen, ox - X, oy - Y, ox, oy, ow, oh, 204); + else + statsGraph->blend(ox - X, oy - Y, ox, oy, ow, oh, 204); + } } // Overlay (if active) @@ -364,10 +366,12 @@ void DesktopWindow::draw() fl_clip_box(ox, oy, ow, oh, ox, oy, ow, oh); - if (offscreen) - overlay->blend(offscreen, ox - X, oy - Y, ox, oy, ow, oh, overlayAlpha); - else - overlay->blend(ox - X, oy - Y, ox, oy, ow, oh, overlayAlpha); + if ((ow != 0) && (oh != 0)) { + if (offscreen) + overlay->blend(offscreen, ox - X, oy - Y, ox, oy, ow, oh, overlayAlpha); + else + overlay->blend(ox - X, oy - Y, ox, oy, ow, oh, overlayAlpha); + } } // Flush offscreen surface to screen |