diff options
| author | Fred Pierresteguy | 1994-05-11 09:33:15 +0000 |
|---|---|---|
| committer | Fred Pierresteguy | 1994-05-11 09:33:15 +0000 |
| commit | adb0462ca4df60d653e323f5166c5278aea6c6f7 (patch) | |
| tree | 1f183c51231e26b83358bfb58f0d5419cdafafe5 /src | |
| parent | 78ffb0db334ca6d5655da61c5a0658a342345edb (diff) | |
| download | emacs-adb0462ca4df60d653e323f5166c5278aea6c6f7.tar.gz emacs-adb0462ca4df60d653e323f5166c5278aea6c6f7.zip | |
(xmenu_show): New var mb_item. Use it to determine the menubar item that
led to the menu.
(Fx_popup_menu): Suppress duplicate test case in the way to determine
whether the menu is handling a menu bar click.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xmenu.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/xmenu.c b/src/xmenu.c index 34438072cb6..3b48ad97afa 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -722,9 +722,7 @@ cached information about equivalent key sequences.") | |||
| 722 | 722 | ||
| 723 | /* Determine whether this menu is handling a menu bar click. */ | 723 | /* Determine whether this menu is handling a menu bar click. */ |
| 724 | tem = Fcar (Fcdr (Fcar (Fcdr (position)))); | 724 | tem = Fcar (Fcdr (Fcar (Fcdr (position)))); |
| 725 | if (XTYPE (Fcar (position)) != Lisp_Cons | 725 | if (CONSP (tem) && EQ (Fcar (tem), Qmenu_bar)) |
| 726 | && CONSP (tem) | ||
| 727 | && EQ (Fcar (tem), Qmenu_bar)) | ||
| 728 | menubarp = 1; | 726 | menubarp = 1; |
| 729 | } | 727 | } |
| 730 | } | 728 | } |
| @@ -1400,19 +1398,21 @@ xmenu_show (f, x, y, menubarp, keymaps, title, error) | |||
| 1400 | { | 1398 | { |
| 1401 | int xbeg; | 1399 | int xbeg; |
| 1402 | int xend = 0; | 1400 | int xend = 0; |
| 1401 | widget_value *mb_item = 0; | ||
| 1403 | 1402 | ||
| 1404 | for (menubar_item = menubar->menu.old_stack[0]->contents; | 1403 | for (mb_item = menubar->menu.old_stack[0]->contents; |
| 1405 | menubar_item; | 1404 | mb_item; |
| 1406 | menubar_item = menubar_item->next) | 1405 | mb_item = mb_item->next) |
| 1407 | { | 1406 | { |
| 1408 | xbeg = xend; | 1407 | xbeg = xend; |
| 1409 | xend += (string_width (menubar, menubar_item->name) | 1408 | xend += (string_width (menubar, mb_item->name) |
| 1410 | + 2 * (menubar->menu.horizontal_spacing | 1409 | + 2 * (menubar->menu.horizontal_spacing |
| 1411 | + menubar->menu.shadow_thickness)); | 1410 | + menubar->menu.shadow_thickness)); |
| 1412 | if (x >= xbeg && x < xend) | 1411 | if (x >= xbeg && x < xend) |
| 1413 | { | 1412 | { |
| 1414 | x = xbeg + 4; | 1413 | x = xbeg + 4; |
| 1415 | y = 0; | 1414 | y = 0; |
| 1415 | menubar_item = mb_item; | ||
| 1416 | /* Arrange to show a different menu if we move in the menu bar | 1416 | /* Arrange to show a different menu if we move in the menu bar |
| 1417 | to a different item. */ | 1417 | to a different item. */ |
| 1418 | this_menu_bar_item_beg = xbeg; | 1418 | this_menu_bar_item_beg = xbeg; |