diff options
-rw-r--r-- | src/xmenu.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/xmenu.c b/src/xmenu.c index 8716d96c6d9..1adf12fbcc0 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -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)); |