summaryrefslogtreecommitdiff
path: root/src/xmenu.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-07-27 20:28:55 +0000
committerRichard M. Stallman <rms@gnu.org>1996-07-27 20:28:55 +0000
commit745c34fbba7eb543b3f17d2f44b23d79198f75a4 (patch)
treec447415b41bf3cab55f0defe4bfb09cc723b6c64 /src/xmenu.c
parent00ddb61e2ef31d1509216fd49200c0fe06bf15d6 (diff)
downloademacs-745c34fbba7eb543b3f17d2f44b23d79198f75a4.tar.gz
(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.
Diffstat (limited to 'src/xmenu.c')
-rw-r--r--src/xmenu.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/xmenu.c b/src/xmenu.c
index bc9a9fb5b45..58a2b323279 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -171,6 +171,8 @@ static int menu_items_submenu_depth;
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 @@ x_activate_menubar (f)
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 @@ set_frame_menubar (f, first_time, deep_p)
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";