diff options
author | Adam Tkac <atkac@redhat.com> | 2011-01-17 10:34:55 +0000 |
---|---|---|
committer | Adam Tkac <atkac@redhat.com> | 2011-01-17 10:34:55 +0000 |
commit | f818725c00436ec21be2a9b871c15ce224be0b65 (patch) | |
tree | c77ebd541bc2aee33a30510fbb3b67f5f07aa66c /unix/tx/TXViewport.cxx | |
parent | 2d4ee587167bba837a31f896a3fc00f6aef6f70d (diff) | |
download | tigervnc-f818725c00436ec21be2a9b871c15ce224be0b65.tar.gz tigervnc-f818725c00436ec21be2a9b871c15ce224be0b65.zip |
[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
Diffstat (limited to 'unix/tx/TXViewport.cxx')
-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(); |