Subject: Re: [patch] xpdf scroll/resize bug
To: None <tech-pkg@netbsd.org>
From: Geert Hendrickx <ghen@netbsd.org>
List: tech-pkg
Date: 12/20/2005 13:37:54
--TB36FDmn/VVEgNH/
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

The attached patch fixes it for me.  Can I commit it?  

Taken from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=324172

	Geert

--TB36FDmn/VVEgNH/
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="xpdf.diff"

Index: Makefile
===================================================================
RCS file: /pub/NetBSD-CVS/pkgsrc/print/xpdf/Makefile,v
retrieving revision 1.45
diff -u -r1.45 Makefile
--- Makefile	18 Dec 2005 20:05:32 -0000	1.45
+++ Makefile	20 Dec 2005 12:37:27 -0000
@@ -2,7 +2,7 @@
 
 DISTNAME=	xpdf-3.01
 PKGNAME=	${DISTNAME}pl1
-PKGREVISION=	2
+PKGREVISION=	3
 CATEGORIES=	print
 MASTER_SITES=	ftp://ftp.foolabs.com/pub/xpdf/ \
 		${MASTER_SITE_SUNSITE:=apps/graphics/viewers/X/xpdf/} \
Index: distinfo
===================================================================
RCS file: /pub/NetBSD-CVS/pkgsrc/print/xpdf/distinfo,v
retrieving revision 1.23
diff -u -r1.23 distinfo
--- distinfo	18 Dec 2005 20:05:32 -0000	1.23
+++ distinfo	20 Dec 2005 12:37:27 -0000
@@ -22,3 +22,4 @@
 SHA1 (patch-an) = 94ea208c43f4df1ac3a9bf01cc874d488ae49a9a
 SHA1 (patch-ar) = f3d320991e189a21244acd31ca5cc6cfdb18bd96
 SHA1 (patch-at) = 8827e22d0f3e341ed45ad92637b02a3a31f3168d
+SHA1 (patch-au) = af765089ee88369da0afef534f46ec50c5cc6d4f
Index: patches/patch-au
===================================================================
RCS file: patches/patch-au
diff -N patches/patch-au
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-au	20 Dec 2005 12:37:27 -0000
@@ -0,0 +1,38 @@
+$NetBSD$
+
+--- xpdf/XPDFCore.cc.orig	2005-12-20 13:30:48.000000000 +0100
++++ xpdf/XPDFCore.cc
+@@ -975,6 +975,9 @@ void XPDFCore::resizeCbk(Widget widget, 
+   XPDFCore *core = (XPDFCore *)ptr;
+   XEvent event;
+   Widget top;
++  Window rootWin;
++  int x1, y1;
++  Guint w1, h1, bw1, depth1;
+   Arg args[2];
+   int n;
+   Dimension w, h;
+@@ -982,15 +985,20 @@ void XPDFCore::resizeCbk(Widget widget, 
+ 
+   // find the top-most widget which has an associated window, and look
+   // for a pending ConfigureNotify in the event queue -- if there is
+-  // one, that means we're still resizing, and we want to skip the
+-  // current event
++  // one, and it specifies a different width or height, that means
++  // we're still resizing, and we want to skip the current event
+   for (top = core->parentWidget;
+        XtParent(top) && XtWindow(XtParent(top));
+        top = XtParent(top)) ;
+   if (XCheckTypedWindowEvent(core->display, XtWindow(top),
+ 			     ConfigureNotify, &event)) {
+     XPutBackEvent(core->display, &event);
+-    return;
++    XGetGeometry(core->display, event.xconfigure.window,
++		 &rootWin, &x1, &y1, &w1, &h1, &bw1, &depth1);
++    if ((Guint)event.xconfigure.width != w1 ||
++	(Guint)event.xconfigure.height != h1) {
++      return;
++    }
+   }
+ 
+   n = 0;

--TB36FDmn/VVEgNH/--