Subject: Menu destruction

From: Dan Espen <[email-masked]>
Date: Tue, 13 Oct 1998 15:37:52 -0400

The next  version of  FvwmAnimate will  create its  own menus.  During
testing, I found  that when FvwmAnimate started  the menu would double
in size.   Of course I have  logic to first  destroy the menu and then
add items   to  the menu. This    logic seems  to   me to  be  suspect
(builtins.c):

void destroy_menu(XEvent *eventp,Window w,FvwmWindow *tmp_win,
                  unsigned long context,
                  char *action, int *Module)
{
  MenuRoot *mr;
  MenuRoot *mrContinuation;

  char *token, *rest;

  rest = GetNextToken(action,&token);
  mr = FindPopup(token);
  if (token)
    free(token);
  while (mr && (mrContinuation = mr->continuation))   <===============
  {
    DestroyMenu(mr);
    mr = mrContinuation;
    if (mr == NULL)
      break;
  }
  return;
}

The  "<====" indicates the  suspicious line.  It  looks  to me like it
will only destroy a  menu that has  continuation.   So far  that seems
consistent with my testing.

Since I haven't downloaded the menu positioning patch, I don't know if
this bug has already been  found.  If I  don't hear otherwise, I  will
eventually fold the fix into  FvwmAnimate, or create a separate branch
for  it.  I  wouldn't mind if   this  was fixed  as  part  of the menu
positioning patch.

--
Dan Espen                                Phone: (732) 699-5570
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Michael M Han <[email-masked]>
Date: Tue, 13 Oct 1998 12:48:24 -0700

Previously...
>add items   to  the menu. This    logic seems  to   me to  be  suspect

I believe someone posted a patch for this some time this summer...
Maybe it was Greg Badros? Anyway, I found something that fixes this in
the fvwm-workers archive, but don't have it handy anymore. Actually, I
need to get a new copy b/c I accidentally blew away my local 2.0.47d
source tree.
_________
mike ([email-masked])
I will not sell school property
 - The collected wisdom of Bart Simpson
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Greg Badros <[email-masked]>
Date: 13 Oct 1998 12:52:50 -0700

> consistent with my testing.

Looks very suspect (and stupid [I can say that because I'm pretty sure I
wrote it -- actually anyone can say that because it is stupid :-)]) to me,
too.  Perhaps:

  while (mr)
      {
      mrContinuation = mr->continuation;  /* save continuation before destroy */
      DestroyMenu(mr);
      mr = mrContinuation;
      }

Good eye.

Greg

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 13 Oct 1998 22:01:14 +0200

[email-masked] wrote:
> Since I haven't downloaded the menu positioning patch,
> I don't know if this bug has already been found.

The bug is in both, 2.0.47d and my patch.

> If I don't hear otherwise, I  will eventually fold the
> fix into FvwmAnimate, or create a separate branch for it.

So what is the status of the CVS repository?
You mentioned beginning from scratch. Has this been done?
I wanted to check in my patches as soon as I get the
confirmation that 'tibbs' (btw. what is his real name?)
has created my account. Should I create a separate branch
or put it in the main branch (or some other branch)?

> I  wouldn't mind if   this  was fixed  as  part  of the menu
> positioning patch.

I assume all that has to be done is to remove the
check for a continuation menu? If yes, I will do that
in my patch too.

Ciao

Dominik
-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883,
[email-masked]
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 13 Oct 1998 22:04:31 +0200

> check for a continuation menu? If yes, I will do that

Forget it, Greg's version seems to be much better ;-)

Ciao

Dominik

---

From: Brad Giaccio <[email-masked]>
Date: Thu, 15 Oct 1998 07:50:23 -0400 (EDT)

If anyone wanted a patch before then Bob Woodside posted a patch on July
9, to the workers list that is exactly what Greg proposed.

Brad

-- 
--- There are two kinds of knowledge, you either know the answer or
			you know where to find it
		      -Kane, Johnson, and anonymous