[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: |
Thu, 03 Feb 2005 14:49:43 -0500 |
Index: emacs/src/xmenu.c
diff -c emacs/src/xmenu.c:1.278 emacs/src/xmenu.c:1.279
*** emacs/src/xmenu.c:1.278 Fri Jan 7 20:50:46 2005
--- emacs/src/xmenu.c Thu Feb 3 19:49:43 2005
***************
*** 1445,1453 ****
/* Find the menu selection and store it in the keyboard buffer.
F is the frame the menu is on.
MENU_BAR_ITEMS_USED is the length of VECTOR.
! VECTOR is an array of menu events for the whole menu.
! */
! void
find_and_call_menu_selection (f, menu_bar_items_used, vector, client_data)
FRAME_PTR f;
int menu_bar_items_used;
--- 1445,1453 ----
/* Find the menu selection and store it in the keyboard buffer.
F is the frame the menu is on.
MENU_BAR_ITEMS_USED is the length of VECTOR.
! VECTOR is an array of menu events for the whole menu. */
!
! static void
find_and_call_menu_selection (f, menu_bar_items_used, vector, client_data)
FRAME_PTR f;
int menu_bar_items_used;
***************
*** 1464,1469 ****
--- 1464,1471 ----
prefix = Qnil;
i = 0;
+ while (gtk_events_pending ())
+ gtk_main_iteration ();
while (i < menu_bar_items_used)
{
if (EQ (XVECTOR (vector)->contents[i], Qnil))
***************
*** 1554,1559 ****
--- 1556,1572 ----
if (! cb_data || ! cb_data->cl_data || ! cb_data->cl_data->f)
return;
+ /* When a menu is popped down, X generates a focus event (i.e. focus
+ goes back to the frame below the menu). Since GTK buffers events,
+ we force it out here before the menu selection event. Otherwise
+ sit-for will exit at once if the focus event follows the menu selection
+ event. */
+
+ BLOCK_INPUT;
+ while (gtk_events_pending ())
+ gtk_main_iteration ();
+ UNBLOCK_INPUT;
+
find_and_call_menu_selection (cb_data->cl_data->f,
cb_data->cl_data->menu_bar_items_used,
cb_data->cl_data->menu_bar_vector,
- [Emacs-diffs] Changes to emacs/src/xmenu.c,
Jan Djärv <=