aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1996-07-27 20:28:55 +0000
committerRichard M. Stallman1996-07-27 20:28:55 +0000
commit745c34fbba7eb543b3f17d2f44b23d79198f75a4 (patch)
treec447415b41bf3cab55f0defe4bfb09cc723b6c64 /src
parent00ddb61e2ef31d1509216fd49200c0fe06bf15d6 (diff)
downloademacs-745c34fbba7eb543b3f17d2f44b23d79198f75a4.tar.gz
emacs-745c34fbba7eb543b3f17d2f44b23d79198f75a4.zip
(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')
-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;
171static int popup_activated_flag; 171static int popup_activated_flag;
172 172
173static int next_menubar_widget_id; 173static int next_menubar_widget_id;
174
175static int pending_menu_activation = 1;
174 176
175#ifdef USE_X_TOOLKIT 177#ifdef USE_X_TOOLKIT
176 178
@@ -1182,12 +1184,14 @@ x_activate_menubar (f)
1182 if (!f->output_data.x->saved_menu_event->type) 1184 if (!f->output_data.x->saved_menu_event->type)
1183 return; 1185 return;
1184 1186
1185 set_frame_menubar (f, 0, 1); 1187 if (f->output_data.x->saved_menu_event->type != ButtonRelease)
1186 1188 set_frame_menubar (f, 0, 1);
1187 BLOCK_INPUT; 1189 BLOCK_INPUT;
1188 XtDispatchEvent ((XEvent *) f->output_data.x->saved_menu_event); 1190 XtDispatchEvent ((XEvent *) f->output_data.x->saved_menu_event);
1189 UNBLOCK_INPUT; 1191 UNBLOCK_INPUT;
1190 1192 if (f->output_data.x->saved_menu_event->type == ButtonRelease)
1193 pending_menu_activation = 1;
1194
1191 /* Ignore this if we get it a second time. */ 1195 /* Ignore this if we get it a second time. */
1192 f->output_data.x->saved_menu_event->type = 0; 1196 f->output_data.x->saved_menu_event->type = 0;
1193} 1197}
@@ -1602,6 +1606,11 @@ set_frame_menubar (f, first_time, deep_p)
1602 1606
1603 if (! menubar_widget) 1607 if (! menubar_widget)
1604 deep_p = 1; 1608 deep_p = 1;
1609 else if (pending_menu_activation && !deep_p)
1610 {
1611 deep_p = 1;
1612 pending_menu_activation = 0;
1613 }
1605 1614
1606 wv = xmalloc_widget_value (); 1615 wv = xmalloc_widget_value ();
1607 wv->name = "menubar"; 1616 wv->name = "menubar";