}
}
\f
-/* Push all the panes and items of a menu decsribed by the
+/* Push all the panes and items of a menu described by the
alist-of-alists MENU.
This handles old-fashioned calls to x-popup-menu. */
#ifdef USE_X_TOOLKIT
/* Loop in Xt until the menu pulldown or dialog popup has been
- popped down (deactivated).
+ popped down (deactivated). This is used for x-popup-menu
+ and x-popup-dialog; it is not used for the menu bar any more.
NOTE: All calls to popup_get_selection should be protected
with BLOCK_INPUT, UNBLOCK_INPUT wrappers. */
if (menu_items_used == i
|| (previous_items[i] != XVECTOR (menu_items)->contents[i]))
break;
- if (i == menu_items_used && i == previous_menu_items_used)
+ if (i == menu_items_used && i == previous_menu_items_used && i != 0)
{
free_menubar_widget_value_tree (first_wv);
menu_items = Qnil;
first_wv->contents = wv;
prev_wv = wv;
}
+
+ /* Forget what we thought we knew about what is in the
+ detailed contents of the menu bar menus.
+ Changing the top level always destroys the contents. */
+ f->menu_bar_items_used = 0;
}
/* Create or update the menu bar widget. */
UNBLOCK_INPUT;
}
-/* Called from Fx_create_frame to create the inital menubar of a frame
+/* Called from Fx_create_frame to create the initial menubar of a frame
before it is mapped, so that the window is mapped with the menubar already
there instead of us tacking it on later and thrashing the window after it
is visible. */