(xmenu_show): Don't queue events that are in the menu bar.
authorRichard M. Stallman <rms@gnu.org>
Sun, 28 Aug 1994 07:39:12 +0000 (07:39 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 28 Aug 1994 07:39:12 +0000 (07:39 +0000)
src/xmenu.c

index 8716d96..1adf12f 100644 (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));