[tigervnc/f14/master] Improve code in vncviewer which decides if scrollbars are needed (#670993).

Adam Tkac atkac at fedoraproject.org
Wed Apr 13 15:07:38 UTC 2011


commit bc796adec384029c2c66bb8209061316b8a3ee10
Author: Adam Tkac <atkac at redhat.com>
Date:   Wed Apr 13 17:03:56 2011 +0200

    Improve code in vncviewer which decides if scrollbars are needed (#670993).
    
    Signed-off-by: Adam Tkac <atkac at redhat.com>

 tigervnc.spec             |    3 +++
 tigervnc11-rh670993.patch |   40 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+), 0 deletions(-)
---
diff --git a/tigervnc.spec b/tigervnc.spec
index 14a0af3..9f310c8 100644
--- a/tigervnc.spec
+++ b/tigervnc.spec
@@ -47,6 +47,7 @@ Patch12:	tigervnc11-rh611677.patch
 Patch13:	tigervnc11-rh633931.patch
 Patch14:	tigervnc11-rh607866.patch
 Patch15:	0001-Use-memmove-instead-of-memcpy-in-fbblt.c-when-memory.patch
+Patch16:	tigervnc11-rh670993.patch
 
 %description
 Virtual Network Computing (VNC) is a remote display system which
@@ -135,6 +136,7 @@ This package contains license of the TigerVNC suite
 %patch12 -p1 -b .rh611677
 %patch13 -p1 -b .rh633931
 %patch14 -p1 -b .rh607866
+%patch16 -p0 -b .rh670993
 
 cp -r /usr/share/xorg-x11-server-source/* unix/xserver
 pushd unix/xserver
@@ -309,6 +311,7 @@ fi
 * Wed Apr 13 2011 Adam Tkac <atkac redhat com> 1.0.90-0.25.20100420svn4030
 - fix wrong usage of memcpy which caused screen artifacts (#652590)
 - don't point to inaccessible link in sysconfig/vncservers (#644975)
+- improve code in vncviewer which decides if scrollbars are needed (#670993)
 
 * Fri Jan 14 2011 Adam Tkac <atkac redhat com> 1.0.90-0.24.20100420svn4030
 - 0001-Return-Success-from-generate_modkeymap-when-max_keys.patch
diff --git a/tigervnc11-rh670993.patch b/tigervnc11-rh670993.patch
new file mode 100644
index 0000000..5197f6a
--- /dev/null
+++ b/tigervnc11-rh670993.patch
@@ -0,0 +1,40 @@
+Index: unix/tx/TXViewport.cxx
+===================================================================
+--- unix/tx/TXViewport.cxx	(revision 4232)
++++ unix/tx/TXViewport.cxx	(revision 4234)
+@@ -118,11 +118,31 @@
+ 
+ void TXViewport::resizeNotify()
+ {
+-  needXScrollbar = (!bumpScroll && width() < child->width() &&
+-		    height() > scrollbarSize && width() > scrollbarSize);
+-  needYScrollbar = (!bumpScroll && height() < child->height() &&
+-		    height() > scrollbarSize && width() > scrollbarSize);
++  int winMaxWidth, winMaxHeight;
+ 
++  winMaxWidth = child->width();
++  winMaxHeight = child->height();
++
++  needXScrollbar = false;
++  needYScrollbar = false;
++  if (!bumpScroll && height() > scrollbarSize && width() > scrollbarSize) {
++    needXScrollbar = (width() < child->width());
++    needYScrollbar = (height() < child->height());
++    // Adding an horizontal scrollbar occupies space, which might cause the
++    // need to add a vertical scrollbar, and vice-versa. These additional
++    // checks should solve this problem
++    if (needXScrollbar && (height() - scrollbarSize < child->height()))
++	needYScrollbar = true;
++    if (needYScrollbar && (width() - scrollbarSize < child->width()))
++	needXScrollbar = true;
++  }
++
++  if (needXScrollbar)
++    winMaxHeight += scrollbarSize;
++  if (needYScrollbar)
++    winMaxWidth += scrollbarSize;
++  setMaxSize(winMaxWidth, winMaxHeight);
++
+   if (needXScrollbar && needYScrollbar) {
+     clipper->resize(width()-scrollbarSize, height()-scrollbarSize);
+     hScrollbar->map();


More information about the scm-commits mailing list