aboutsummaryrefslogtreecommitdiffstats
path: root/src/xmenu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmenu.c')
-rw-r--r--src/xmenu.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/xmenu.c b/src/xmenu.c
index 5c3d5804355..145e4f70b9c 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -110,11 +110,12 @@ extern Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map;
110extern Lisp_Object Qmenu_bar_update_hook; 110extern Lisp_Object Qmenu_bar_update_hook;
111 111
112#ifdef USE_X_TOOLKIT 112#ifdef USE_X_TOOLKIT
113extern void set_frame_menubar (); 113extern void set_frame_menubar P_ ((FRAME_PTR, int, int));
114extern XtAppContext Xt_app_con; 114extern XtAppContext Xt_app_con;
115 115
116static Lisp_Object xdialog_show (); 116static Lisp_Object xdialog_show P_ ((FRAME_PTR, int, Lisp_Object, char **));
117static void popup_get_selection (); 117static void popup_get_selection P_ ((XEvent *, struct x_display_info *,
118 LWLIB_ID, int));
118 119
119/* Define HAVE_BOXES if menus can handle radio and toggle buttons. */ 120/* Define HAVE_BOXES if menus can handle radio and toggle buttons. */
120 121
@@ -124,8 +125,8 @@ static void popup_get_selection ();
124#ifdef USE_GTK 125#ifdef USE_GTK
125#include "gtkutil.h" 126#include "gtkutil.h"
126#define HAVE_BOXES 1 127#define HAVE_BOXES 1
127extern void set_frame_menubar (); 128extern void set_frame_menubar P_ ((FRAME_PTR, int, int));
128static Lisp_Object xdialog_show (); 129static Lisp_Object xdialog_show P_ ((FRAME_PTR, int, Lisp_Object, char **));
129#endif 130#endif
130 131
131/* This is how to deal with multibyte text if HAVE_MULTILINGUAL_MENU 132/* This is how to deal with multibyte text if HAVE_MULTILINGUAL_MENU
@@ -156,7 +157,6 @@ static void single_keymap_panes P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
156static void list_of_panes P_ ((Lisp_Object)); 157static void list_of_panes P_ ((Lisp_Object));
157static void list_of_items P_ ((Lisp_Object)); 158static void list_of_items P_ ((Lisp_Object));
158 159
159extern EMACS_TIME timer_check P_ ((int));
160 160
161/* This holds a Lisp vector that holds the results of decoding 161/* This holds a Lisp vector that holds the results of decoding
162 the keymaps or alist-of-alists that specify a menu. 162 the keymaps or alist-of-alists that specify a menu.
@@ -1120,29 +1120,28 @@ on the left of the dialog box and all following items on the right.
1120 popped down (deactivated). This is used for x-popup-menu 1120 popped down (deactivated). This is used for x-popup-menu
1121 and x-popup-dialog; it is not used for the menu bar. 1121 and x-popup-dialog; it is not used for the menu bar.
1122 1122
1123 If DO_TIMERS is nonzero, run timers.
1124 If DOWN_ON_KEYPRESS is nonzero, pop down if a key is pressed. 1123 If DOWN_ON_KEYPRESS is nonzero, pop down if a key is pressed.
1125 1124
1125 This function used to have a DO_TIMERS argument which was
1126 1 in the dialog case, and caused it to run Lisp-level timers.
1127 That was unsafe so we removed it, but does anyone remember
1128 why menus and dialogs were treated differently?
1129
1126 NOTE: All calls to popup_get_selection should be protected 1130 NOTE: All calls to popup_get_selection should be protected
1127 with BLOCK_INPUT, UNBLOCK_INPUT wrappers. */ 1131 with BLOCK_INPUT, UNBLOCK_INPUT wrappers. */
1128 1132
1129#ifdef USE_X_TOOLKIT 1133#ifdef USE_X_TOOLKIT
1130static void 1134static void
1131popup_get_selection (initial_event, dpyinfo, id, do_timers, down_on_keypress) 1135popup_get_selection (initial_event, dpyinfo, id, down_on_keypress)
1132 XEvent *initial_event; 1136 XEvent *initial_event;
1133 struct x_display_info *dpyinfo; 1137 struct x_display_info *dpyinfo;
1134 LWLIB_ID id; 1138 LWLIB_ID id;
1135 int do_timers;
1136 int down_on_keypress; 1139 int down_on_keypress;
1137{ 1140{
1138 XEvent event; 1141 XEvent event;
1139 1142
1140 while (popup_activated_flag) 1143 while (popup_activated_flag)
1141 { 1144 {
1142 /* If we have no events to run, consider timers. */
1143 if (do_timers && !XtAppPending (Xt_app_con))
1144 timer_check (1);
1145
1146 if (initial_event) 1145 if (initial_event)
1147 { 1146 {
1148 event = *initial_event; 1147 event = *initial_event;
@@ -2489,7 +2488,7 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click)
2489 popup_activated_flag = 1; 2488 popup_activated_flag = 1;
2490 2489
2491 /* Process events that apply to the menu. */ 2490 /* Process events that apply to the menu. */
2492 popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), menu_id, 0, 0); 2491 popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), menu_id, 0);
2493 2492
2494 /* fp turned off the following statement and wrote a comment 2493 /* fp turned off the following statement and wrote a comment
2495 that it is unnecessary--that the menu has already disappeared. 2494 that it is unnecessary--that the menu has already disappeared.
@@ -2883,8 +2882,7 @@ create_and_show_dialog (f, first_wv)
2883 Fcons (make_number (dialog_id >> (fact)), 2882 Fcons (make_number (dialog_id >> (fact)),
2884 make_number (dialog_id & ~(-1 << (fact))))); 2883 make_number (dialog_id & ~(-1 << (fact)))));
2885 2884
2886 popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), 2885 popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), dialog_id, 1);
2887 dialog_id, 1, 1);
2888 2886
2889 unbind_to (count, Qnil); 2887 unbind_to (count, Qnil);
2890 } 2888 }