From f818725c00436ec21be2a9b871c15ce224be0b65 Mon Sep 17 00:00:00 2001 From: Adam Tkac Date: Mon, 17 Jan 2011 10:34:55 +0000 Subject: [PATCH] [Bugfix] TXViewport: set the window max width/height considering the scrollbars Thanks to Paulo Zanoni for the patch. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4233 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- unix/tx/TXViewport.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) 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(); -- 2.39.5