diff options
-rw-r--r-- | unix/tx/TXViewport.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/unix/tx/TXViewport.cxx b/unix/tx/TXViewport.cxx index 2ee2336b..7a1e95b7 100644 --- a/unix/tx/TXViewport.cxx +++ b/unix/tx/TXViewport.cxx @@ -118,11 +118,22 @@ bool TXViewport::handleTimeout(rfb::Timer* timer) { void TXViewport::resizeNotify() { + int winMaxWidth, winMaxHeight; + + winMaxWidth = child->width(); + winMaxHeight = child->height(); + needXScrollbar = (!bumpScroll && width() < child->width() && height() > scrollbarSize && width() > scrollbarSize); needYScrollbar = (!bumpScroll && height() < child->height() && height() > scrollbarSize && width() > scrollbarSize); + if (needXScrollbar) + winMaxHeight += scrollbarSize; + if (needYScrollbar) + winMaxWidth += scrollbarSize; + setMaxSize(winMaxWidth, winMaxHeight); + if (needXScrollbar && needYScrollbar) { clipper->resize(width()-scrollbarSize, height()-scrollbarSize); hScrollbar->map(); |