summaryrefslogtreecommitdiff
path: root/src/xmenu.c
diff options
context:
space:
mode:
authorFred Pierresteguy <F.Pierresteguy@frcl.bull.fr>1994-05-11 09:33:15 +0000
committerFred Pierresteguy <F.Pierresteguy@frcl.bull.fr>1994-05-11 09:33:15 +0000
commitbd397291860caaee5a96b1017a869eda566fa02c (patch)
treecdcdd6b33b656bafdae84e83eafc1e6221d8183d /src/xmenu.c
parent97689ad73e609de62d999905f6fc9211a887a485 (diff)
downloademacs-bd397291860caaee5a96b1017a869eda566fa02c.tar.gz
(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/xmenu.c')
-rw-r--r--src/xmenu.c14
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.")
/* Determine whether this menu is handling a menu bar click. */
tem = Fcar (Fcdr (Fcar (Fcdr (position))));
- if (XTYPE (Fcar (position)) != Lisp_Cons
- && CONSP (tem)
- && EQ (Fcar (tem), Qmenu_bar))
+ if (CONSP (tem) && EQ (Fcar (tem), Qmenu_bar))
menubarp = 1;
}
}
@@ -1400,19 +1398,21 @@ xmenu_show (f, x, y, menubarp, keymaps, title, error)
{
int xbeg;
int xend = 0;
+ widget_value *mb_item = 0;
- for (menubar_item = menubar->menu.old_stack[0]->contents;
- menubar_item;
- menubar_item = menubar_item->next)
+ for (mb_item = menubar->menu.old_stack[0]->contents;
+ mb_item;
+ mb_item = mb_item->next)
{
xbeg = xend;
- xend += (string_width (menubar, menubar_item->name)
+ xend += (string_width (menubar, mb_item->name)
+ 2 * (menubar->menu.horizontal_spacing
+ menubar->menu.shadow_thickness));
if (x >= xbeg && x < xend)
{
x = xbeg + 4;
y = 0;
+ menubar_item = mb_item;
/* Arrange to show a different menu if we move in the menu bar
to a different item. */
this_menu_bar_item_beg = xbeg;