diff options
| author | Richard M. Stallman | 1997-07-26 01:40:05 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-07-26 01:40:05 +0000 |
| commit | ccc1cac01682ab7c0e9d72d8b022eb84684b3a44 (patch) | |
| tree | 1c86b61a1141320890c7eaf906a25441cae538b7 | |
| parent | 7cf45b048e6e184543a616cfad20ce535516ea96 (diff) | |
| download | emacs-ccc1cac01682ab7c0e9d72d8b022eb84684b3a44.tar.gz emacs-ccc1cac01682ab7c0e9d72d8b022eb84684b3a44.zip | |
(display_menu): If an item is disabled,
don't display its submenu (if any).
| -rw-r--r-- | lwlib/xlwmenu.c | 13 |
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, | |||
| 644 | int horizontal_p = mw->menu.horizontal && (level == 0); | 644 | int horizontal_p = mw->menu.horizontal && (level == 0); |
| 645 | int highlighted_p; | 645 | int highlighted_p; |
| 646 | int just_compute_this_one_p; | 646 | int just_compute_this_one_p; |
| 647 | /* This is set nonzero if the element containing HIGHLIGHTED_POS | ||
| 648 | is disabled, so that we do not return any subsequent element either. */ | ||
| 649 | int no_return = 0; | ||
| 647 | 650 | ||
| 648 | if (level >= mw->menu.old_depth) | 651 | if (level >= mw->menu.old_depth) |
| 649 | abort (); | 652 | abort (); |
| @@ -688,8 +691,14 @@ display_menu (mw, level, just_compute_p, highlighted_pos, hit, hit_return, | |||
| 688 | if (hit | 691 | if (hit |
| 689 | && !*hit_return | 692 | && !*hit_return |
| 690 | && (horizontal_p ? hit->x < where.x : hit->y < where.y) | 693 | && (horizontal_p ? hit->x < where.x : hit->y < where.y) |
| 691 | && !all_dashes_p (val->name)) | 694 | && !all_dashes_p (val->name) |
| 692 | *hit_return = val; | 695 | && !no_return) |
| 696 | { | ||
| 697 | if (val->enabled) | ||
| 698 | *hit_return = val; | ||
| 699 | else | ||
| 700 | no_return = 1; | ||
| 701 | } | ||
| 693 | 702 | ||
| 694 | if (horizontal_p) | 703 | if (horizontal_p) |
| 695 | where.y = 0; | 704 | where.y = 0; |