summaryrefslogtreecommitdiff
path: root/lwlib
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-07-26 01:40:05 +0000
committerRichard M. Stallman <rms@gnu.org>1997-07-26 01:40:05 +0000
commitccc1cac01682ab7c0e9d72d8b022eb84684b3a44 (patch)
tree1c86b61a1141320890c7eaf906a25441cae538b7 /lwlib
parent7cf45b048e6e184543a616cfad20ce535516ea96 (diff)
downloademacs-ccc1cac01682ab7c0e9d72d8b022eb84684b3a44.tar.gz
(display_menu): If an item is disabled,
don't display its submenu (if any).
Diffstat (limited to 'lwlib')
-rw-r--r--lwlib/xlwmenu.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c
index d80fa0118c5..6fece5cdb87 100644
--- a/lwlib/xlwmenu.c
+++ b/lwlib/xlwmenu.c
@@ -644,6 +644,9 @@ display_menu (mw, level, just_compute_p, highlighted_pos, hit, hit_return,
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 @@ display_menu (mw, level, just_compute_p, highlighted_pos, hit, hit_return,
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;