aboutsummaryrefslogtreecommitdiffstats
path: root/src/xmenu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmenu.c')
-rw-r--r--src/xmenu.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/xmenu.c b/src/xmenu.c
index 1650222ae84..b615d321cc7 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -97,10 +97,10 @@ Boston, MA 02110-1301, USA. */
97#define FALSE 0 97#define FALSE 0
98#endif /* no TRUE */ 98#endif /* no TRUE */
99 99
100Lisp_Object Vmenu_updating_frame;
101
102Lisp_Object Qdebug_on_next_call; 100Lisp_Object Qdebug_on_next_call;
103 101
102extern Lisp_Object Vmenu_updating_frame;
103
104extern Lisp_Object Qmenu_bar; 104extern Lisp_Object Qmenu_bar;
105 105
106extern Lisp_Object QCtoggle, QCradio; 106extern Lisp_Object QCtoggle, QCradio;
@@ -1191,6 +1191,10 @@ x_menu_set_in_use (in_use)
1191{ 1191{
1192 menu_items_inuse = in_use ? Qt : Qnil; 1192 menu_items_inuse = in_use ? Qt : Qnil;
1193 popup_activated_flag = in_use; 1193 popup_activated_flag = in_use;
1194#ifdef USE_X_TOOLKIT
1195 if (popup_activated_flag)
1196 x_activate_timeout_atimer ();
1197#endif
1194} 1198}
1195 1199
1196/* Wait for an X event to arrive or for a timer to expire. */ 1200/* Wait for an X event to arrive or for a timer to expire. */
@@ -1310,7 +1314,7 @@ popup_get_selection (initial_event, dpyinfo, id, do_timers)
1310 } 1314 }
1311} 1315}
1312 1316
1313DEFUN ("x-menu-bar-open", Fx_menu_bar_open, Sx_menu_bar_open, 0, 1, "i", 1317DEFUN ("x-menu-bar-open-internal", Fx_menu_bar_open_internal, Sx_menu_bar_open_internal, 0, 1, "i",
1314 doc: /* Start key navigation of the menu bar in FRAME. 1318 doc: /* Start key navigation of the menu bar in FRAME.
1315This initially opens the first menu bar item and you can then navigate with the 1319This initially opens the first menu bar item and you can then navigate with the
1316arrow keys, select a menu entry with the return key or cancel with the 1320arrow keys, select a menu entry with the return key or cancel with the
@@ -1389,7 +1393,7 @@ If FRAME is nil or not given, use the selected frame. */)
1389 1393
1390 1394
1391#ifdef USE_GTK 1395#ifdef USE_GTK
1392DEFUN ("x-menu-bar-open", Fx_menu_bar_open, Sx_menu_bar_open, 0, 1, "i", 1396DEFUN ("x-menu-bar-open-internal", Fx_menu_bar_open_internal, Sx_menu_bar_open_internal, 0, 1, "i",
1393 doc: /* Start key navigation of the menu bar in FRAME. 1397 doc: /* Start key navigation of the menu bar in FRAME.
1394This initially opens the first menu bar item and you can then navigate with the 1398This initially opens the first menu bar item and you can then navigate with the
1395arrow keys, select a menu entry with the return key or cancel with the 1399arrow keys, select a menu entry with the return key or cancel with the
@@ -1510,6 +1514,9 @@ popup_activate_callback (widget, id, client_data)
1510 XtPointer client_data; 1514 XtPointer client_data;
1511{ 1515{
1512 popup_activated_flag = 1; 1516 popup_activated_flag = 1;
1517#ifdef USE_X_TOOLKIT
1518 x_activate_timeout_atimer ();
1519#endif
1513} 1520}
1514#endif 1521#endif
1515 1522
@@ -2828,6 +2835,7 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click)
2828 /* Display the menu. */ 2835 /* Display the menu. */
2829 lw_popup_menu (menu, (XEvent *) &dummy); 2836 lw_popup_menu (menu, (XEvent *) &dummy);
2830 popup_activated_flag = 1; 2837 popup_activated_flag = 1;
2838 x_activate_timeout_atimer ();
2831 2839
2832 { 2840 {
2833 int fact = 4 * sizeof (LWLIB_ID); 2841 int fact = 4 * sizeof (LWLIB_ID);
@@ -3214,6 +3222,7 @@ create_and_show_dialog (f, first_wv)
3214 /* Display the dialog box. */ 3222 /* Display the dialog box. */
3215 lw_pop_up_all_widgets (dialog_id); 3223 lw_pop_up_all_widgets (dialog_id);
3216 popup_activated_flag = 1; 3224 popup_activated_flag = 1;
3225 x_activate_timeout_atimer ();
3217 3226
3218 /* Process events that apply to the dialog box. 3227 /* Process events that apply to the dialog box.
3219 Also handle timers. */ 3228 Also handle timers. */
@@ -3803,11 +3812,6 @@ syms_of_xmenu ()
3803 Qdebug_on_next_call = intern ("debug-on-next-call"); 3812 Qdebug_on_next_call = intern ("debug-on-next-call");
3804 staticpro (&Qdebug_on_next_call); 3813 staticpro (&Qdebug_on_next_call);
3805 3814
3806 DEFVAR_LISP ("menu-updating-frame", &Vmenu_updating_frame,
3807 doc: /* Frame for which we are updating a menu.
3808The enable predicate for a menu command should check this variable. */);
3809 Vmenu_updating_frame = Qnil;
3810
3811#ifdef USE_X_TOOLKIT 3815#ifdef USE_X_TOOLKIT
3812 widget_id_tick = (1<<16); 3816 widget_id_tick = (1<<16);
3813 next_menubar_widget_id = 1; 3817 next_menubar_widget_id = 1;
@@ -3816,10 +3820,9 @@ The enable predicate for a menu command should check this variable. */);
3816 defsubr (&Sx_popup_menu); 3820 defsubr (&Sx_popup_menu);
3817 3821
3818#if defined (USE_GTK) || defined (USE_X_TOOLKIT) 3822#if defined (USE_GTK) || defined (USE_X_TOOLKIT)
3819 defsubr (&Sx_menu_bar_open); 3823 defsubr (&Sx_menu_bar_open_internal);
3820 Fdefalias (intern ("accelerate-menu"), 3824 Ffset (intern ("accelerate-menu"),
3821 intern (Sx_menu_bar_open.symbol_name), 3825 intern (Sx_menu_bar_open_internal.symbol_name));
3822 Qnil);
3823#endif 3826#endif
3824 3827
3825#ifdef HAVE_MENUS 3828#ifdef HAVE_MENUS