Subject: small menu bugfixes

From: Dominik Vogt <[email-masked]>
Date: Sun, 17 Jan 1999 13:56:01 +0100

Here is a small patch that addresses two menu bugs:

1) AddToMenu cannot be used to insert separators
2) A 'long' separator (MenuStyle * SeparatorsLong)
   reaches one pixel into the border of the menu on
   the right.

None of these is serious enough to make it into 2.2
The fix for (1) is a bit dangerous too (might make
fvwm2 coredump elsewhere, but I don't believe it will).

Bye

Dominik

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--- ChangeLog.orig	Sun Jan 17 13:13:49 1999
+++ ChangeLog	Sun Jan 17 13:51:31 1999
@@ -1,3 +1,9 @@
+1999-01-17  Dominik Vogt  <[email-masked]>
+
+	* fvwm/menus.c (PaintEntry): long separators reached into the border
+	of the menu to the right, but not on the left
+	(AddToMenu): AddToMenu could not be used to enter separators
+
 1999-01-16  Steven Michael ROBBINS  <[email-masked]>
 
 	* configure.in: Nuke cached values before retrying check for
--- fvwm/menus.c.orig	Sun Jan 17 13:32:56 1999
+++ fvwm/menus.c	Sun Jan 17 13:49:55 1999
@@ -1716,11 +1716,11 @@
   /* see if it's an actual separator (titles are also separators) */
   if(mi->fIsSeparator && !IS_TITLE_MENU_ITEM(mi) && !IS_LABEL_MENU_ITEM(mi))
     {
-      int d = (mr->ms->look.f.LongSeparators) ? 3 : 0;
+      int d = (mr->ms->look.f.LongSeparators) ? 4 : 6;
 
       DrawSeparator(mr->w,ShadowGC,ReliefGC,mr->xoffset+5-d,
 		    y_offset-1+HEIGHT_SEPARATOR/2,
-		    mr->width-6+d,y_offset-1+HEIGHT_SEPARATOR/2,1);
+		    mr->width-d,y_offset-1+HEIGHT_SEPARATOR/2,1);
     }
   if(mi->next == NULL)
     DrawSeparator(mr->w,ShadowGC,ShadowGC,mr->xoffset+1,mr->height-2,
@@ -2778,7 +2778,8 @@
   char *token2 = NULL;
   char *option = NULL;
 
-  if ((item == NULL || *item == 0) && fNoPlus)
+  if ((item == NULL || *item == 0) && (action == NULL || *action == 0) &&
+      fNoPlus)
     return;
   /* empty items screw up our menu when painted, so we replace them with a
    * separator */