diff options
| author | Karoly Lorentey | 2004-11-13 18:21:48 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2004-11-13 18:21:48 +0000 |
| commit | f590a2a442d19f3a74d7bbd02bbcb4e3239f2327 (patch) | |
| tree | 0ea1998c7a87cdc3faa9d00d3ea71b981cc1153a /src/xmenu.c | |
| parent | 050ddd28da8d0bb44f06575e93c6bd7feb758829 (diff) | |
| parent | c37ee7cb84b11bf38e1f391b2015a2ec74e5c4e1 (diff) | |
| download | emacs-f590a2a442d19f3a74d7bbd02bbcb4e3239f2327.tar.gz emacs-f590a2a442d19f3a74d7bbd02bbcb4e3239f2327.zip | |
Merged in changes from CVS trunk.
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-672
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-266
Diffstat (limited to 'src/xmenu.c')
| -rw-r--r-- | src/xmenu.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/xmenu.c b/src/xmenu.c index 145e4f70b9c..a08f4610101 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -115,7 +115,7 @@ 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 | ||
| @@ -157,6 +157,8 @@ static void single_keymap_panes P_ ((Lisp_Object, Lisp_Object, Lisp_Object, | |||
| 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 | 159 | ||
| 160 | extern EMACS_TIME timer_check P_ ((int)); | ||
| 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. |
| @@ -1122,27 +1124,27 @@ on the left of the dialog box and all following items on the right. | |||
| 1122 | 1124 | ||
| 1123 | 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. |
| 1124 | 1126 | ||
| 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 | |||
| 1130 | NOTE: All calls to popup_get_selection should be protected | 1127 | NOTE: All calls to popup_get_selection should be protected |
| 1131 | with BLOCK_INPUT, UNBLOCK_INPUT wrappers. */ | 1128 | with BLOCK_INPUT, UNBLOCK_INPUT wrappers. */ |
| 1132 | 1129 | ||
| 1133 | #ifdef USE_X_TOOLKIT | 1130 | #ifdef USE_X_TOOLKIT |
| 1134 | static void | 1131 | static void |
| 1135 | popup_get_selection (initial_event, dpyinfo, id, down_on_keypress) | 1132 | popup_get_selection (initial_event, dpyinfo, id, do_timers, down_on_keypress) |
| 1136 | XEvent *initial_event; | 1133 | XEvent *initial_event; |
| 1137 | struct x_display_info *dpyinfo; | 1134 | struct x_display_info *dpyinfo; |
| 1138 | LWLIB_ID id; | 1135 | LWLIB_ID id; |
| 1136 | int do_timers; | ||
| 1139 | int down_on_keypress; | 1137 | int down_on_keypress; |
| 1140 | { | 1138 | { |
| 1141 | XEvent event; | 1139 | XEvent event; |
| 1142 | 1140 | ||
| 1143 | while (popup_activated_flag) | 1141 | while (popup_activated_flag) |
| 1144 | { | 1142 | { |
| 1145 | 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) | ||
| 1146 | { | 1148 | { |
| 1147 | event = *initial_event; | 1149 | event = *initial_event; |
| 1148 | initial_event = 0; | 1150 | initial_event = 0; |
| @@ -2488,7 +2490,7 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click) | |||
| 2488 | popup_activated_flag = 1; | 2490 | popup_activated_flag = 1; |
| 2489 | 2491 | ||
| 2490 | /* Process events that apply to the menu. */ | 2492 | /* Process events that apply to the menu. */ |
| 2491 | 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); |
| 2492 | 2494 | ||
| 2493 | /* fp turned off the following statement and wrote a comment | 2495 | /* fp turned off the following statement and wrote a comment |
| 2494 | that it is unnecessary--that the menu has already disappeared. | 2496 | that it is unnecessary--that the menu has already disappeared. |
| @@ -2882,7 +2884,8 @@ create_and_show_dialog (f, first_wv) | |||
| 2882 | Fcons (make_number (dialog_id >> (fact)), | 2884 | Fcons (make_number (dialog_id >> (fact)), |
| 2883 | make_number (dialog_id & ~(-1 << (fact))))); | 2885 | make_number (dialog_id & ~(-1 << (fact))))); |
| 2884 | 2886 | ||
| 2885 | 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); | ||
| 2886 | 2889 | ||
| 2887 | unbind_to (count, Qnil); | 2890 | unbind_to (count, Qnil); |
| 2888 | } | 2891 | } |