Mercurial > emacs
comparison src/xmenu.c @ 72854:f295b430aa3a
* xterm.c (x_initialize): Don't install Xt event timer here.
(x_timeout_atimer_activated_flag): New var.
(x_activate_timeout_atimer): New function to install Xt timer.
(x_send_scroll_bar_event, x_process_timeouts): Use it.
* xmenu.c (x_menu_set_in_use, popup_activate_callback)
(create_and_show_popup_menu, create_and_show_dialog): Use it.
* xterm.h (x_activate_timeout_atimer): prototype.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Wed, 13 Sep 2006 22:39:23 +0000 |
parents | 6db6c056fc46 |
children | 332f0639af48 a1a25ac6c88a |
comparison
equal
deleted
inserted
replaced
72853:4ee2b4b1cf76 | 72854:f295b430aa3a |
---|---|
1180 x_menu_set_in_use (in_use) | 1180 x_menu_set_in_use (in_use) |
1181 int in_use; | 1181 int in_use; |
1182 { | 1182 { |
1183 menu_items_inuse = in_use ? Qt : Qnil; | 1183 menu_items_inuse = in_use ? Qt : Qnil; |
1184 popup_activated_flag = in_use; | 1184 popup_activated_flag = in_use; |
1185 #ifdef USE_X_TOOLKIT | |
1186 if (popup_activated_flag) | |
1187 x_activate_timeout_atimer (); | |
1188 #endif | |
1185 } | 1189 } |
1186 | 1190 |
1187 /* Wait for an X event to arrive or for a timer to expire. */ | 1191 /* Wait for an X event to arrive or for a timer to expire. */ |
1188 | 1192 |
1189 void | 1193 void |
1496 Widget widget; | 1500 Widget widget; |
1497 LWLIB_ID id; | 1501 LWLIB_ID id; |
1498 XtPointer client_data; | 1502 XtPointer client_data; |
1499 { | 1503 { |
1500 popup_activated_flag = 1; | 1504 popup_activated_flag = 1; |
1505 #ifdef USE_X_TOOLKIT | |
1506 x_activate_timeout_atimer (); | |
1507 #endif | |
1501 } | 1508 } |
1502 #endif | 1509 #endif |
1503 | 1510 |
1504 /* This callback is invoked when a dialog or menu is finished being | 1511 /* This callback is invoked when a dialog or menu is finished being |
1505 used and has been unposted. */ | 1512 used and has been unposted. */ |
2796 XtSetValues (menu, av, ac); | 2803 XtSetValues (menu, av, ac); |
2797 | 2804 |
2798 /* Display the menu. */ | 2805 /* Display the menu. */ |
2799 lw_popup_menu (menu, (XEvent *) &dummy); | 2806 lw_popup_menu (menu, (XEvent *) &dummy); |
2800 popup_activated_flag = 1; | 2807 popup_activated_flag = 1; |
2808 x_activate_timeout_atimer (); | |
2801 | 2809 |
2802 { | 2810 { |
2803 int fact = 4 * sizeof (LWLIB_ID); | 2811 int fact = 4 * sizeof (LWLIB_ID); |
2804 int specpdl_count = SPECPDL_INDEX (); | 2812 int specpdl_count = SPECPDL_INDEX (); |
2805 record_unwind_protect (pop_down_menu, | 2813 record_unwind_protect (pop_down_menu, |
3173 lw_modify_all_widgets (dialog_id, first_wv->contents, True); | 3181 lw_modify_all_widgets (dialog_id, first_wv->contents, True); |
3174 | 3182 |
3175 /* Display the dialog box. */ | 3183 /* Display the dialog box. */ |
3176 lw_pop_up_all_widgets (dialog_id); | 3184 lw_pop_up_all_widgets (dialog_id); |
3177 popup_activated_flag = 1; | 3185 popup_activated_flag = 1; |
3186 x_activate_timeout_atimer (); | |
3178 | 3187 |
3179 /* Process events that apply to the dialog box. | 3188 /* Process events that apply to the dialog box. |
3180 Also handle timers. */ | 3189 Also handle timers. */ |
3181 { | 3190 { |
3182 int count = SPECPDL_INDEX (); | 3191 int count = SPECPDL_INDEX (); |