changeset 18993:c3bfd473a4d3

(display_menu): If an item is disabled, don't display its submenu (if any).
author Richard M. Stallman <rms@gnu.org>
date Sat, 26 Jul 1997 01:40:05 +0000
parents f0453e066438
children 015e9d877871
files lwlib/xlwmenu.c
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lwlib/xlwmenu.c	Fri Jul 25 22:33:06 1997 +0000
+++ b/lwlib/xlwmenu.c	Sat Jul 26 01:40:05 1997 +0000
@@ -644,6 +644,9 @@
   int horizontal_p = mw->menu.horizontal && (level == 0);
   int highlighted_p;
   int just_compute_this_one_p;
+  /* This is set nonzero if the element containing HIGHLIGHTED_POS
+     is disabled, so that we do not return any subsequent element either.  */
+  int no_return = 0;
 
   if (level >= mw->menu.old_depth)
     abort ();
@@ -688,8 +691,14 @@
       if (hit
 	  && !*hit_return
 	  && (horizontal_p ? hit->x < where.x : hit->y < where.y)
-	  && !all_dashes_p (val->name))
-	*hit_return = val;
+	  && !all_dashes_p (val->name)
+	  && !no_return)
+	{
+	  if (val->enabled)
+	    *hit_return = val;
+	  else
+	    no_return = 1;
+	}
 
       if (horizontal_p)
 	where.y = 0;