1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-20 18:17:20 +00:00

(xmenu_show): Don't queue events that are in the menu bar.

This commit is contained in:
Richard M. Stallman 1994-08-28 07:39:12 +00:00
parent f7d786d0cb
commit 03b78673fb

View File

@ -1650,7 +1650,7 @@ xmenu_show (f, x, y, menubarp, keymaps, title, error)
{
XEvent event;
int queue_and_exit = 0;
int in_this_menu;
int in_this_menu = 0, in_menu_bar = 0;
Widget widget;
XtAppNextEvent (Xt_app_con, &event);
@ -1658,7 +1658,7 @@ xmenu_show (f, x, y, menubarp, keymaps, title, error)
/* Check whether the event happened in the menu
or any child of it. */
widget = XtWindowToWidget (XDISPLAY event.xany.window);
in_this_menu = 0;
while (widget)
{
if (widget == menu)
@ -1666,6 +1666,11 @@ xmenu_show (f, x, y, menubarp, keymaps, title, error)
in_this_menu = 1;
break;
}
if (widget == f->display.x->menubar_widget)
{
in_menu_bar = 1;
break;
}
widget = XtParent (widget);
}
@ -1742,7 +1747,7 @@ xmenu_show (f, x, y, menubarp, keymaps, title, error)
XtDispatchEvent (&event);
if (queue_and_exit || !in_this_menu)
if (queue_and_exit || (!in_this_menu && !in_menu_bar))
{
queue_tmp
= (struct event_queue *) malloc (sizeof (struct event_queue));