]> source.dussan.org Git - tigervnc.git/commitdiff
[Bugfix] TXViewport: set the window max width/height considering the scrollbars
authorAdam Tkac <atkac@redhat.com>
Mon, 17 Jan 2011 10:34:55 +0000 (10:34 +0000)
committerAdam Tkac <atkac@redhat.com>
Mon, 17 Jan 2011 10:34:55 +0000 (10:34 +0000)
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

index 2ee2336b098e7bb8bf49ffb3adcd25ee7c69eda9..7a1e95b71ac6b19e8652f4d0b3e2b3ccd151ebbf 100644 (file)
@@ -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();