Commit 742f715d authored by Karl Heuer's avatar Karl Heuer
Browse files

(xmenu_show): Disallow empty menus.

parent b137c582
......@@ -1399,6 +1399,11 @@ xmenu_show (f, x, y, menubarp, keymaps, title, error)
*error = NULL;
if (menu_items_used <= MENU_ITEMS_PANE_LENGTH)
{
*error = "Empty menu";
return Qnil;
}
this_menu_bar_item_beg = -1;
this_menu_bar_item_end = -1;
last_menu_bar_item_end = -1;
......@@ -2010,6 +2015,12 @@ xmenu_show (f, x, y, menubarp, keymaps, title, error)
if (menu_items_n_panes == 0)
return Qnil;
if (menu_items_used <= MENU_ITEMS_PANE_LENGTH)
{
*error = "Empty menu";
return Qnil;
}
/* Figure out which root window F is on. */
XGetGeometry (x_current_display, FRAME_X_WINDOW (f), &root,
&dummy_int, &dummy_int, &dummy_uint, &dummy_uint,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment