On Fri, 14 Mar 2008 18:27:57 +0100
Dominik Vogt <[EMAIL PROTECTED]> wrote:

> On Fri, Mar 14, 2008 at 06:15:36PM +0100, Dominik Vogt wrote:
> > On Wed, Mar 12, 2008 at 01:31:14AM +0100, Jesús Guerrero wrote:
> > > I attach an updated version of the patch, with test cases, docs, Changelog
> > > and NEWS included. I hope everything is correct. If not, just let me know.
> > 
> > I'll apply the patch ...
> 
> But there is a bug.  It I specify
> 
>   menustyle * verticalmargins 50 50, borderwidth 50 50, verticalitemspacing 
> 50 50
> 
> I end up with menus that are taller than the screen.  It seems
> that the verticalmargins are not taken into account when fvwm
> calculates when to add a continuation menu (More...).

I forgot to add the margins into the calculations to see how the menu fit
on the height of the screen. As far as I know, there are two of these checks,
one just to check that, and another to see if there's a need to discard one
more item on the current column.

I attach a fix, I hope it's all fine now.

Cheers.
-- 
Jesús Guerrero <[EMAIL PROTECTED]>
diff -r -U3 fvwm/fvwm/menus.c fvwm/fvwm/menus.c
--- fvwm/fvwm/menus.c	2008-03-17 00:01:03.000000000 +0100
+++ fvwm/fvwm/menus.c	2008-03-17 13:04:49.000000000 +0100
@@ -1703,7 +1703,9 @@
 		/* this item would have to be the last item, or else
 		 * we need to add a "More..." entry pointing to a new menu */
 		if (y + MST_BORDER_WIDTH(msp->menu) +
-		    ((MI_IS_SELECTABLE(mi)) ? relief_thickness : 0)
+				((MI_IS_SELECTABLE(mi)) ? relief_thickness : 0) +
+				MST_VERTICAL_MARGIN_TOP(msp->menu) +
+				MST_VERTICAL_MARGIN_BOTTOM(msp->menu)
 		    > MR_SCREEN_HEIGHT(msp->menu))
 		{
 			/* Item does not fit on screen anymore. */
@@ -1721,6 +1723,8 @@
 				mi = MI_PREV_ITEM(mi);
 				cItems--;
 				if (y + MST_BORDER_WIDTH(msp->menu) +
+	  	      MST_VERTICAL_MARGIN_TOP(msp->menu) +
+  	  	    MST_VERTICAL_MARGIN_BOTTOM(msp->menu) +
 				    simple_entry_height +
 				    2 * relief_thickness <=
 				    MR_SCREEN_HEIGHT(msp->menu))
--- /var/portage/distfiles/cvs-src/fvwm/ChangeLog	2008-03-17 00:01:02.000000000 +0100
+++ fvwm/ChangeLog	2008-03-17 13:26:21.000000000 +0100
@@ -1,3 +1,8 @@
+2008-03-17  Jesús Guerrero  <i92guboj(at)terra(dot)es>
+
+	* fvwm/menus.c (size_menu_vertically):
+	fix calculations so the menu fit on the screen height
+
 2008-03-12  Jes~s Guerrero  <i92guboj(at)terra(dot)es>
 
 	* fvwm/menus.c (size_menu_vertically):

Reply via email to