On Sat, Jan 02, 2010 at 01:49:27PM -0500, [email protected] wrote:
> I bring up a menu, pin it with button 2 on the title bar, then
> click on a pixmap on the title bar with an X.
> The button is bound to:

[...]

Thanks.  I think I was able to reproduce this, by inferring the backtrace
you sent, and me using a config which utterly broke FVWM when trying to
tear-off a menu using either a MenuFace of TiledPixmap or Pixmap.

Does the attached patch fix the problem for you?  I've not committed it to
CVS because I am still unsure if the problem this patch fixes is related to
yours or not.  :P

-- Thomas Adam

-- 
"It was the cruelest game I've ever played and it's played inside my head."
-- "Hush The Warmth", Gorky's Zygotic Mynci.
Index: menustyle.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/menustyle.c,v
retrieving revision 1.43
diff -u -r1.43 menustyle.c
--- menustyle.c	14 Mar 2008 17:22:42 -0000	1.43
+++ menustyle.c	3 Jan 2010 02:01:48 -0000
@@ -133,12 +133,26 @@
 	case PixmapMenu:
 	case TiledPixmapMenu:
 		fpa.mask = (Pdepth <= 8)?  FPAM_DITHER:0;
-		destmf->u.p = PCacheFvwmPicture(
-			dpy, Scr.NoFocusWin, NULL, origmf->u.p->name,
-			fpa);
+		
+		destmf->type = origmf->type;
+		
+		if (destmf->u.p) 
+		{
+			PDestroyFvwmPicture(dpy, destmf->u.p);
+			destmf->u.p = NULL;
+		}
+
+		if (origmf->u.p)
+		{
+			destmf->u.p = PCacheFvwmPicture(
+				dpy, Scr.NoFocusWin, NULL, origmf->u.p->name,
+				fpa);
+
+			return;
+		}
+		
 		fvwmlib_copy_color(
 			dpy, &destmf->u.back, &origmf->u.back, False,True);
-		destmf->type = origmf->type;
 		break;
 	default:
 		break;

Reply via email to