changeset 8651:f8249d9f509d

(xmenu_show): Don't queue events that are in the menu bar.
author Richard M. Stallman <rms@gnu.org>
date Sun, 28 Aug 1994 07:39:12 +0000
parents deb008af7049
children c2c1a477ddd5
files src/xmenu.c
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/xmenu.c	Sun Aug 28 07:37:42 1994 +0000
+++ b/src/xmenu.c	Sun Aug 28 07:39:12 1994 +0000
@@ -1650,7 +1650,7 @@
     {
       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 @@
       /* 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 @@
 	      in_this_menu = 1;
 	      break;
 	    }
+	  if (widget == f->display.x->menubar_widget)
+	    {
+	      in_menu_bar = 1;
+	      break;
+	    }
 	  widget = XtParent (widget);
 	}
 
@@ -1742,7 +1747,7 @@
 
       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));