[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/xmenu.c
From: |
Jan Djärv |
Subject: |
[Emacs-diffs] Changes to emacs/src/xmenu.c |
Date: |
Fri, 12 Nov 2004 05:53:08 -0500 |
Index: emacs/src/xmenu.c
diff -c emacs/src/xmenu.c:1.265 emacs/src/xmenu.c:1.266
*** emacs/src/xmenu.c:1.265 Fri Nov 12 09:36:55 2004
--- emacs/src/xmenu.c Fri Nov 12 10:34:36 2004
***************
*** 1132,1138 ****
while (
#ifdef USE_X_TOOLKIT
! XtAppPending (Xt_app_con)
#elif defined USE_GTK
! gtk_events_pending ()
#else
--- 1132,1138 ----
while (
#ifdef USE_X_TOOLKIT
! ! XtAppPending (Xt_app_con)
#elif defined USE_GTK
! gtk_events_pending ()
#else
***************
*** 1171,1176 ****
--- 1171,1185 ----
#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
+ #ifdef USE_X_TOOLKIT
+
+ static Lisp_Object
+ pop_down_menu (dummy)
+ int dummy;
+ {
+ popup_activated_flag = 0;
+ }
+
/* Loop in Xt until the menu pulldown or dialog popup has been
popped down (deactivated). This is used for x-popup-menu
and x-popup-dialog; it is not used for the menu bar.
***************
*** 1180,1186 ****
NOTE: All calls to popup_get_selection should be protected
with BLOCK_INPUT, UNBLOCK_INPUT wrappers. */
- #ifdef USE_X_TOOLKIT
static void
popup_get_selection (initial_event, dpyinfo, id, do_timers, down_on_keypress)
XEvent *initial_event;
--- 1189,1194 ----
***************
*** 1191,1196 ****
--- 1199,1207 ----
{
XEvent event;
+ int specpdl_count = SPECPDL_INDEX ();
+ record_unwind_protect (pop_down_menu, Qnil);
+
while (popup_activated_flag)
{
if (initial_event)
***************
*** 1240,1245 ****
--- 1251,1258 ----
x_dispatch_event (&event, event.xany.display);
}
+
+ unbind_to (specpdl_count, Qnil);
}
#endif /* USE_X_TOOLKIT */
***************
*** 1247,1256 ****
#ifdef USE_GTK
/* Loop util popup_activated_flag is set to zero in a callback.
Used for popup menus and dialogs. */
static void
! popup_widget_loop (do_timers)
int do_timers;
{
++popup_activated_flag;
/* Process events in the Gtk event loop until done. */
--- 1260,1288 ----
#ifdef USE_GTK
/* Loop util popup_activated_flag is set to zero in a callback.
Used for popup menus and dialogs. */
+ static GtkWidget *current_menu;
+
+ static Lisp_Object
+ pop_down_menu (dummy)
+ int dummy;
+ {
+ if (current_menu)
+ {
+ gtk_widget_unmap (current_menu);
+ current_menu = 0;
+ popup_activated_flag = 0;
+ }
+ }
+
static void
! popup_widget_loop (do_timers, widget)
int do_timers;
+ GtkWidget *widget;
{
+ int specpdl_count = SPECPDL_INDEX ();
+ current_menu = widget;
+ record_unwind_protect (pop_down_menu, Qnil);
+
++popup_activated_flag;
/* Process events in the Gtk event loop until done. */
***************
*** 1259,1264 ****
--- 1291,1298 ----
if (do_timers) x_menu_wait_for_event (0);
gtk_main_iteration ();
}
+
+ unbind_to (specpdl_count, Qnil);
}
#endif
***************
*** 2456,2462 ****
two. show_help_echo uses this to detect popup menus. */
popup_activated_flag = 1;
/* Process events that apply to the menu. */
! popup_widget_loop (1);
gtk_widget_destroy (menu);
--- 2490,2496 ----
two. show_help_echo uses this to detect popup menus. */
popup_activated_flag = 1;
/* Process events that apply to the menu. */
! popup_widget_loop (1, 0);
gtk_widget_destroy (menu);
***************
*** 2865,2871 ****
gtk_widget_show_all (menu);
/* Process events that apply to the menu. */
! popup_widget_loop (1);
gtk_widget_destroy (menu);
}
--- 2899,2905 ----
gtk_widget_show_all (menu);
/* Process events that apply to the menu. */
! popup_widget_loop (1, menu);
gtk_widget_destroy (menu);
}
- [Emacs-diffs] Changes to emacs/src/xmenu.c, Richard M . Stallman, 2004/11/04
- [Emacs-diffs] Changes to emacs/src/xmenu.c, Jan Djärv, 2004/11/06
- [Emacs-diffs] Changes to emacs/src/xmenu.c, Jan Djärv, 2004/11/12
- [Emacs-diffs] Changes to emacs/src/xmenu.c, Jan Djärv, 2004/11/12
- [Emacs-diffs] Changes to emacs/src/xmenu.c,
Jan Djärv <=
- [Emacs-diffs] Changes to emacs/src/xmenu.c, Kim F . Storm, 2004/11/12
- [Emacs-diffs] Changes to emacs/src/xmenu.c, Jan Djärv, 2004/11/13
- [Emacs-diffs] Changes to emacs/src/xmenu.c, Jan Djärv, 2004/11/13
- [Emacs-diffs] Changes to emacs/src/xmenu.c, Jan Djärv, 2004/11/14
- [Emacs-diffs] Changes to emacs/src/xmenu.c, Jan Djärv, 2004/11/14
- [Emacs-diffs] Changes to emacs/src/xmenu.c, Jan Djärv, 2004/11/16