From parv@chvlva.adelphia.net  Fri Oct 22 06:49:28 2004
Return-Path: <parv@chvlva.adelphia.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A60C016A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 22 Oct 2004 06:49:28 +0000 (GMT)
Received: from mta10.adelphia.net (mta10.adelphia.net [68.168.78.202])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 2B45843D45
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 22 Oct 2004 06:49:28 +0000 (GMT)
	(envelope-from parv@chvlva.adelphia.net)
Received: from default.chvlva.adelphia.net ([69.160.70.47])
          by mta10.adelphia.net
          (InterMail vM.6.01.03.02 201-2131-111-104-20040324) with ESMTP
          id <20041022064927.KKPV18454.mta10.adelphia.net@default.chvlva.adelphia.net>
          for <FreeBSD-gnats-submit@freebsd.org>;
          Fri, 22 Oct 2004 02:49:27 -0400
Received: by default.chvlva.adelphia.net (Postfix, from userid 1000)
	id 6B06F5A54; Fri, 22 Oct 2004 02:51:53 -0400 (EDT)
Message-Id: <20041022065153.6B06F5A54@default.chvlva.adelphia.net>
Date: Fri, 22 Oct 2004 02:51:53 -0400 (EDT)
From: parv@pair.com
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: x11-wm/fvwm2-devel - PATCH to remove endless loop in fvwm/icons.c
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         72992
>Category:       ports
>Synopsis:       x11-wm/fvwm2-devel - PATCH to remove endless loop in fvwm/icons.c
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    cy
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 22 06:50:23 GMT 2004
>Closed-Date:    Thu Oct 28 14:21:13 GMT 2004
>Last-Modified:  Thu Oct 28 14:21:13 GMT 2004
>Originator:     parv
>Release:        FreeBSD 4.10-RELEASE-p3 i386
>Organization:
>Environment:

System: FreeBSD moo.holy.cow 4.10-RELEASE-p3


>Description:

In fvwm2 unstable versions 2.5.1[02], there is inifinte loop in
fvwm/icons.c related to transient/parent windows.  Patch given below
fixes that.

As this patch was generated w/ diff's from 2.5.12 & cvs source around
Oct 19, fvwm2-devel needs to be updated first; cannot say if it will
work w/ 2.5.10.

This patch must be removed when the version 2.5.13 is released as it
has been fixed in (fvwm) cvs as of Oct 17, 2004, 12p.


See also...

  http://www.hpc.uh.edu/fvwm/archive/0410/msg00142.html
  http://www.hpc.uh.edu/fvwm/archive/0410/msg00151.html


>How-To-Repeat:

Apply the patch in work/fvwm-2.5.12/.


>Fix:

(Mind the embedded tabs.)

--- fvwm/icons.c.orig	Wed Mar 17 09:42:54 2004
+++ fvwm/icons.c	Tue Oct 19 16:13:55 2004
@@ -2251,7 +2251,7 @@
  */
 void DeIconify(FvwmWindow *fw)
 {
-	FvwmWindow *t,*tmp;
+	FvwmWindow *t, *tmp, *ofw;
 	FvwmWindow *sf = get_focus_window();
 	rectangle icon_rect;
 	XWindowAttributes winattrs = {0};
@@ -2276,15 +2276,18 @@
 		SET_ICONIFY_AFTER_MAP(fw, 0);
 		return;
 	}
-	while (IS_ICONIFIED_BY_PARENT(fw))
+	for (ofw = NULL; fw != ofw && IS_ICONIFIED_BY_PARENT(fw); )
 	{
-		for (t = Scr.FvwmRoot.next; t != NULL; t = t->next)
+		t = get_transientfor_fvwmwindow(fw);
+		if (t != NULL)
 		{
-			if (t != fw && FW_W_TRANSIENTFOR(fw) == FW_W(t))
-			{
-				fw = t;
-			}
+			ofw = fw;
+			fw = t;
 		}
+	}
+	if (IS_ICONIFIED_BY_PARENT(fw))
+	{
+		SET_ICONIFIED_BY_PARENT(fw, 0);
 	}
 
 	/* AS dje  RaiseWindow(fw); */
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->cy 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Oct 23 23:43:47 GMT 2004 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72992 
State-Changed-From-To: open->closed 
State-Changed-By: cy 
State-Changed-When: Thu Oct 28 14:18:01 GMT 2004 
State-Changed-Why:  
Committed. Thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72992 
>Unformatted:
