Package: gv
Version: 1:3.7.1-1bfw2
Severity: normal
Tags: patch
The TOC widget scrolls downwards when selecting its last visible entry. This
makes sense for long lists that do not fit into the widget so you can keep
track of where you are while browsing throuh the document. However, the widget
also scrolls downwards if you select the very last entry which is not necessary
as there are no more entries to come. In particular, this is unexpected and
very annoying for short lists where all entries can be perfectly seen as it
hides the first entry.
The attached patch fixes this behavior by preventing the widget to scroll
downwards if it is the very last entry that gets selected. As a result, the
downward and upward scrolling behavior gets consistent when reaching the very
last or first entry.
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (x86_64)
Kernel: Linux 2.6.33.1-64 (SMP w/16 CPU cores; PREEMPT)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Versions of packages gv depends on:
ii dpkg 1.15.7.2 Debian package management system
ii ghostscript-x 8.71~dfsg2-6bfw1 The GPL Ghostscript PostScript/PDF
ii install-info 4.13a.dfsg.1-5 Manage installed documentation in
ii libc6 2.11.2-2bfw1 Embedded GNU C Library: Shared lib
ii libx11-6 2:1.3.3-3 X11 client-side library
ii libxinerama1 2:1.1-3 X11 Xinerama extension library
ii libxmu6 2:1.0.5-1 X11 miscellaneous utility library
ii libxt6 1:1.0.7-1 X11 toolkit intrinsics library
ii xaw3dg 1.5+E-18 Xaw3d widget set
Versions of packages gv recommends:
ii xaw3dg 1.5+E-18 Xaw3d widget set
gv suggests no packages.
-- Configuration Files:
/etc/X11/app-defaults/GV changed [not included]
-- no debconf information
diff -u -r gv-3.7.1/src/misc.c gv-3.7.1-patched/src/misc.c
--- gv-3.7.1/src/misc.c 2010-06-03 18:36:25.000000000 +0200
+++ gv-3.7.1-patched/src/misc.c 2010-08-27 14:18:31.692487366 +0200
@@ -323,7 +323,7 @@
else
VlistSetFirstVisible(newtoc, entry);
b = True;
- } else {
+ } else if (entry < VlistEntries(newtoc) - 1) {
/* sadly newtoc does not know it's height, so it cannot be told
* to made an item visible and we need to trick: */
lastvisible = VlistEntryOfPosition(newtoc, newtocClip->core.height);