1445 |
/* Find the menu selection and store it in the keyboard buffer. |
/* Find the menu selection and store it in the keyboard buffer. |
1446 |
F is the frame the menu is on. |
F is the frame the menu is on. |
1447 |
MENU_BAR_ITEMS_USED is the length of VECTOR. |
MENU_BAR_ITEMS_USED is the length of VECTOR. |
1448 |
VECTOR is an array of menu events for the whole menu. |
VECTOR is an array of menu events for the whole menu. */ |
1449 |
*/ |
|
1450 |
void |
static void |
1451 |
find_and_call_menu_selection (f, menu_bar_items_used, vector, client_data) |
find_and_call_menu_selection (f, menu_bar_items_used, vector, client_data) |
1452 |
FRAME_PTR f; |
FRAME_PTR f; |
1453 |
int menu_bar_items_used; |
int menu_bar_items_used; |
1464 |
prefix = Qnil; |
prefix = Qnil; |
1465 |
i = 0; |
i = 0; |
1466 |
|
|
1467 |
|
while (gtk_events_pending ()) |
1468 |
|
gtk_main_iteration (); |
1469 |
while (i < menu_bar_items_used) |
while (i < menu_bar_items_used) |
1470 |
{ |
{ |
1471 |
if (EQ (XVECTOR (vector)->contents[i], Qnil)) |
if (EQ (XVECTOR (vector)->contents[i], Qnil)) |
1556 |
if (! cb_data || ! cb_data->cl_data || ! cb_data->cl_data->f) |
if (! cb_data || ! cb_data->cl_data || ! cb_data->cl_data->f) |
1557 |
return; |
return; |
1558 |
|
|
1559 |
|
/* When a menu is popped down, X generates a focus event (i.e. focus |
1560 |
|
goes back to the frame below the menu). Since GTK buffers events, |
1561 |
|
we force it out here before the menu selection event. Otherwise |
1562 |
|
sit-for will exit at once if the focus event follows the menu selection |
1563 |
|
event. */ |
1564 |
|
|
1565 |
|
BLOCK_INPUT; |
1566 |
|
while (gtk_events_pending ()) |
1567 |
|
gtk_main_iteration (); |
1568 |
|
UNBLOCK_INPUT; |
1569 |
|
|
1570 |
find_and_call_menu_selection (cb_data->cl_data->f, |
find_and_call_menu_selection (cb_data->cl_data->f, |
1571 |
cb_data->cl_data->menu_bar_items_used, |
cb_data->cl_data->menu_bar_items_used, |
1572 |
cb_data->cl_data->menu_bar_vector, |
cb_data->cl_data->menu_bar_vector, |