On Thu, Apr 28, 2011 at 12:09:10AM +0200, Jesús J. Guerrero Botella wrote:
> Hello.
> 
> I am experiencing an odd problem when I use FvwmButtons in conjunction
> with RootTransparent based colorsets. If I specify a global one for
> the panel everything seems ok. The problem starts when I want to use a
> different (also transparent) colorset in a given cell. Then, on
> Restart, FvwmButtons doesn't die, instead it starts consuming cpu time
> like mad, and I can see that a new FvwmButtons piles up in the htop
> list.
> 
> I have been able to reproduce this problem with the attached config,
> which I think is minimal enough.
> 
> The process is as follows:
> 1.- use the attached config
> 2.- make sure the first line points to a valid image, otherwise the
> transparency won't work, and the bug won't show up
> 3.- start fvwm
> 4.- restart many times
> 5.- keep an eye in htop, top or whatever you use
> 
> Can anyone else reproduce this on fvwm 2.6.1/2.7?

Does the patch attached help?

-- Thomas Adam

-- 
"Deep in my heart I wish I was wrong.  But deep in my heart I know I am
not." -- Morrissey ("Girl Least Likely To" -- off of Viva Hate.)
Index: modules/FvwmButtons/FvwmButtons.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmButtons/FvwmButtons.c,v
retrieving revision 1.207
diff -u -p -r1.207 FvwmButtons.c
--- modules/FvwmButtons/FvwmButtons.c	22 Jul 2007 23:01:50 -0000	1.207
+++ modules/FvwmButtons/FvwmButtons.c	27 Apr 2011 23:47:43 -0000
@@ -276,7 +276,27 @@ static void DeadPipeCleanup(void)
 
 	signal(SIGPIPE, SIG_IGN);/* Xsync may cause SIGPIPE */
 
-	MyXGrabServer(Dpy); /* We don't want interference right now */
+	button = -1;
+	ub = UberButton;
+	while (NextButton(&ub, &b, &button, 1))
+	{
+		/* The picture pointer is NULL if the pixmap came from a
+		 * colorset. */
+		if (b->flags.b_Icon && b->icon != NULL)
+		{
+			PDestroyFvwmPicture(Dpy, b->icon);
+		}
+		if (b->flags.b_IconBack && b->backicon != NULL)
+		{
+			PDestroyFvwmPicture(Dpy, b->icon);
+		}
+		if (b->flags.b_Container && b->c->flags.b_IconBack &&
+			!(b->c->flags.b_TransBack) && b->c->backicon != NULL)
+		{
+			PDestroyFvwmPicture(Dpy, b->c->backicon);
+		}
+
+	}
 	while (NextButton(&ub, &b, &button, 0))
 	{
 		swin = SwallowedWindow(b);
@@ -347,31 +367,8 @@ static void DeadPipeCleanup(void)
 #endif
 		}
 	}
-	XSync(Dpy, 0);
-	MyXUngrabServer(Dpy); /* We're through */
 
 	fsm_close();
-	/* Hey, we have to free the pictures too! */
-	button = -1;
-	ub = UberButton;
-	while (NextButton(&ub, &b, &button, 1))
-	{
-		/* The picture pointer is NULL if the pixmap came from a
-		 * colorset. */
-		if (b->flags.b_Icon && b->icon != NULL)
-		{
-			PDestroyFvwmPicture(Dpy, b->icon);
-		}
-		if (b->flags.b_IconBack && b->backicon != NULL)
-		{
-			PDestroyFvwmPicture(Dpy, b->icon);
-		}
-		if (b->flags.b_Container && b->c->flags.b_IconBack &&
-			!(b->c->flags.b_TransBack) && b->c->backicon != NULL)
-		{
-			PDestroyFvwmPicture(Dpy, b->c->backicon);
-		}
-	}
 }
 
 /**

Reply via email to