comparison src/xmenu.c @ 15710:85d87cd0f655

(x_activate_menubar): Allow any event, not just ButtonPress.
author Karl Heuer <kwzh@gnu.org>
date Tue, 16 Jul 1996 06:01:13 +0000
parents f74c79dcaf8d
children 9902d8a8a548
comparison
equal deleted inserted replaced
15709:32550876ed0f 15710:85d87cd0f655
1165 /* Activate the menu bar of frame F. 1165 /* Activate the menu bar of frame F.
1166 This is called from keyboard.c when it gets the 1166 This is called from keyboard.c when it gets the
1167 menu_bar_activate_event out of the Emacs event queue. 1167 menu_bar_activate_event out of the Emacs event queue.
1168 1168
1169 To activate the menu bar, we use the X button-press event 1169 To activate the menu bar, we use the X button-press event
1170 that was saved in saved_button_event. 1170 that was saved in saved_menu_event.
1171 That makes the toolkit do its thing. 1171 That makes the toolkit do its thing.
1172 1172
1173 But first we recompute the menu bar contents (the whole tree). 1173 But first we recompute the menu bar contents (the whole tree).
1174 1174
1175 The reason for saving the button event until here, instead of 1175 The reason for saving the button event until here, instead of
1177 execute Lisp code. */ 1177 execute Lisp code. */
1178 1178
1179 x_activate_menubar (f) 1179 x_activate_menubar (f)
1180 FRAME_PTR f; 1180 FRAME_PTR f;
1181 { 1181 {
1182 if (f->output_data.x->saved_button_event->type != ButtonPress) 1182 if (!f->output_data.x->saved_menu_event->type)
1183 return; 1183 return;
1184 1184
1185 set_frame_menubar (f, 0, 1); 1185 set_frame_menubar (f, 0, 1);
1186 1186
1187 BLOCK_INPUT; 1187 BLOCK_INPUT;
1188 XtDispatchEvent ((XEvent *) f->output_data.x->saved_button_event); 1188 XtDispatchEvent ((XEvent *) f->output_data.x->saved_menu_event);
1189 UNBLOCK_INPUT; 1189 UNBLOCK_INPUT;
1190 1190
1191 /* Ignore this if we get it a second time. */ 1191 /* Ignore this if we get it a second time. */
1192 f->output_data.x->saved_button_event->type = 0; 1192 f->output_data.x->saved_menu_event->type = 0;
1193 } 1193 }
1194 1194
1195 /* Detect if a dialog or menu has been posted. */ 1195 /* Detect if a dialog or menu has been posted. */
1196 1196
1197 int 1197 int