comparison src/xmenu.c @ 90044:cb7f41387eb3

Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-70 Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-669 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-678 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-679 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-680 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-688 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-690 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-691 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-69 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-70 - miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-71 Update from CVS
author Miles Bader <miles@gnu.org>
date Fri, 12 Nov 2004 02:53:04 +0000
parents e24e2e78deda 9b14127a651a
children b637c617432f
comparison
equal deleted inserted replaced
90043:e24e2e78deda 90044:cb7f41387eb3
113 extern void set_frame_menubar P_ ((FRAME_PTR, int, int)); 113 extern void set_frame_menubar P_ ((FRAME_PTR, int, int));
114 extern XtAppContext Xt_app_con; 114 extern XtAppContext Xt_app_con;
115 115
116 static Lisp_Object xdialog_show P_ ((FRAME_PTR, int, Lisp_Object, char **)); 116 static Lisp_Object xdialog_show P_ ((FRAME_PTR, int, Lisp_Object, char **));
117 static void popup_get_selection P_ ((XEvent *, struct x_display_info *, 117 static void popup_get_selection P_ ((XEvent *, struct x_display_info *,
118 LWLIB_ID, int)); 118 LWLIB_ID, int, int));
119 119
120 /* Define HAVE_BOXES if menus can handle radio and toggle buttons. */ 120 /* Define HAVE_BOXES if menus can handle radio and toggle buttons. */
121 121
122 #define HAVE_BOXES 1 122 #define HAVE_BOXES 1
123 #endif /* USE_X_TOOLKIT */ 123 #endif /* USE_X_TOOLKIT */
154 static void keymap_panes P_ ((Lisp_Object *, int, int)); 154 static void keymap_panes P_ ((Lisp_Object *, int, int));
155 static void single_keymap_panes P_ ((Lisp_Object, Lisp_Object, Lisp_Object, 155 static void single_keymap_panes P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
156 int, int)); 156 int, int));
157 static void list_of_panes P_ ((Lisp_Object)); 157 static void list_of_panes P_ ((Lisp_Object));
158 static void list_of_items P_ ((Lisp_Object)); 158 static void list_of_items P_ ((Lisp_Object));
159
160 extern EMACS_TIME timer_check P_ ((int));
159 161
160 162
161 /* This holds a Lisp vector that holds the results of decoding 163 /* This holds a Lisp vector that holds the results of decoding
162 the keymaps or alist-of-alists that specify a menu. 164 the keymaps or alist-of-alists that specify a menu.
163 165
1118 1120
1119 /* Loop in Xt until the menu pulldown or dialog popup has been 1121 /* Loop in Xt until the menu pulldown or dialog popup has been
1120 popped down (deactivated). This is used for x-popup-menu 1122 popped down (deactivated). This is used for x-popup-menu
1121 and x-popup-dialog; it is not used for the menu bar. 1123 and x-popup-dialog; it is not used for the menu bar.
1122 1124
1123 If DO_TIMERS is nonzero, run timers.
1124 If DOWN_ON_KEYPRESS is nonzero, pop down if a key is pressed. 1125 If DOWN_ON_KEYPRESS is nonzero, pop down if a key is pressed.
1125 1126
1126 NOTE: All calls to popup_get_selection should be protected 1127 NOTE: All calls to popup_get_selection should be protected
1127 with BLOCK_INPUT, UNBLOCK_INPUT wrappers. */ 1128 with BLOCK_INPUT, UNBLOCK_INPUT wrappers. */
1128 1129
1129 #ifdef USE_X_TOOLKIT 1130 #ifdef USE_X_TOOLKIT
1130 static void 1131 static void
1131 popup_get_selection (initial_event, dpyinfo, id, down_on_keypress) 1132 popup_get_selection (initial_event, dpyinfo, id, do_timers, down_on_keypress)
1132 XEvent *initial_event; 1133 XEvent *initial_event;
1133 struct x_display_info *dpyinfo; 1134 struct x_display_info *dpyinfo;
1134 LWLIB_ID id; 1135 LWLIB_ID id;
1136 int do_timers;
1135 int down_on_keypress; 1137 int down_on_keypress;
1136 { 1138 {
1137 XEvent event; 1139 XEvent event;
1138 1140
1139 while (popup_activated_flag) 1141 while (popup_activated_flag)
1140 { 1142 {
1141 if (initial_event) 1143 /* If we have no events to run, consider timers. */
1144 if (do_timers && !XtAppPending (Xt_app_con))
1145 timer_check (1);
1146
1147 if (initial_event)
1142 { 1148 {
1143 event = *initial_event; 1149 event = *initial_event;
1144 initial_event = 0; 1150 initial_event = 0;
1145 } 1151 }
1146 else 1152 else
2482 /* Display the menu. */ 2488 /* Display the menu. */
2483 lw_popup_menu (menu, (XEvent *) &dummy); 2489 lw_popup_menu (menu, (XEvent *) &dummy);
2484 popup_activated_flag = 1; 2490 popup_activated_flag = 1;
2485 2491
2486 /* Process events that apply to the menu. */ 2492 /* Process events that apply to the menu. */
2487 popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), menu_id, 0); 2493 popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), menu_id, 0, 0);
2488 2494
2489 /* fp turned off the following statement and wrote a comment 2495 /* fp turned off the following statement and wrote a comment
2490 that it is unnecessary--that the menu has already disappeared. 2496 that it is unnecessary--that the menu has already disappeared.
2491 Nowadays the menu disappears ok, all right, but 2497 Nowadays the menu disappears ok, all right, but
2492 we need to delete the widgets or multiple ones will pile up. */ 2498 we need to delete the widgets or multiple ones will pile up. */
2876 /* xdialog_show_unwind is responsible for popping the dialog box down. */ 2882 /* xdialog_show_unwind is responsible for popping the dialog box down. */
2877 record_unwind_protect (xdialog_show_unwind, 2883 record_unwind_protect (xdialog_show_unwind,
2878 Fcons (make_number (dialog_id >> (fact)), 2884 Fcons (make_number (dialog_id >> (fact)),
2879 make_number (dialog_id & ~(-1 << (fact))))); 2885 make_number (dialog_id & ~(-1 << (fact)))));
2880 2886
2881 popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), dialog_id, 1); 2887 popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f),
2888 dialog_id, 1, 1);
2882 2889
2883 unbind_to (count, Qnil); 2890 unbind_to (count, Qnil);
2884 } 2891 }
2885 } 2892 }
2886 2893