changeset 15792:feeb1f7c1cec

(pending_menu_activation): New variable. (x_activate_menubar): Don't call set_frame_menubar for ButtonRelease events. Instead, set pending_menu_activation. (set_frame_menubar): If pending_menu_activation, set deep_p.
author Richard M. Stallman <rms@gnu.org>
date Sat, 27 Jul 1996 20:28:55 +0000
parents 15f3befe7705
children fc460a98a7f9
files src/xmenu.c
diffstat 1 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/xmenu.c	Sat Jul 27 20:23:55 1996 +0000
+++ b/src/xmenu.c	Sat Jul 27 20:28:55 1996 +0000
@@ -171,6 +171,8 @@
 static int popup_activated_flag;
 
 static int next_menubar_widget_id;
+
+static int pending_menu_activation = 1;
 
 #ifdef USE_X_TOOLKIT
 
@@ -1182,12 +1184,14 @@
   if (!f->output_data.x->saved_menu_event->type)
     return;
 
-  set_frame_menubar (f, 0, 1);
-
+  if (f->output_data.x->saved_menu_event->type != ButtonRelease)
+    set_frame_menubar (f, 0, 1);
   BLOCK_INPUT;
   XtDispatchEvent ((XEvent *) f->output_data.x->saved_menu_event);
   UNBLOCK_INPUT;
-
+  if (f->output_data.x->saved_menu_event->type == ButtonRelease)
+    pending_menu_activation = 1;
+  
   /* Ignore this if we get it a second time.  */
   f->output_data.x->saved_menu_event->type = 0;
 }
@@ -1602,6 +1606,11 @@
 
   if (! menubar_widget)
     deep_p = 1;
+  else if (pending_menu_activation && !deep_p)
+    {
+      deep_p = 1;
+      pending_menu_activation = 0;
+    }
 
   wv = xmalloc_widget_value ();
   wv->name = "menubar";