struct frame *f = NULL;
Lisp_Object x, y, window;
int menuflags = 0;
- ptrdiff_t specpdl_count = SPECPDL_INDEX ();
+ dynwind_begin ();
+ ptrdiff_t specpdl_count2;
struct gcpro gcpro1;
if (NILP (position))
/* This is an obsolete call, which wants us to precompute the
keybinding equivalents, but we don't do that any more anyway. */
- return Qnil;
+ {
+ dynwind_end ();
+ return Qnil;
+ }
{
bool get_current_pos_p = 0;
{
int cur_x, cur_y;
- mouse_position_for_popup (new_f, &cur_x, &cur_y);
+ x_relative_mouse_position (new_f, &cur_x, &cur_y);
/* cur_x/y may be negative, so use make_number. */
x = make_number (cur_x);
y = make_number (cur_y);
menuflags &= ~MENU_KEYMAPS;
}
- unbind_to (specpdl_count, Qnil);
+ dynwind_end ();
#ifdef HAVE_WINDOW_SYSTEM
/* Hide a previous tip, if any. */
}
#endif
+ dynwind_begin ();
+
#ifdef HAVE_NS /* FIXME: ns-specific, why? --Stef */
record_unwind_protect_void (discard_menu_items);
#endif
selection = FRAME_TERMINAL (f)->menu_show_hook (f, xpos, ypos, menuflags,
title, &error_name);
-#ifdef HAVE_NS
- unbind_to (specpdl_count, Qnil);
-#else
+#ifndef HAVE_NS
discard_menu_items ();
#endif
+ dynwind_end ();
+
#ifdef HAVE_NTGUI /* FIXME: Is it really w32-specific? --Stef */
if (FRAME_W32_P (f))
FRAME_DISPLAY_INFO (f)->grabbed = 0;
void
syms_of_menu (void)
{
+#include "menu.x"
+
staticpro (&menu_items);
menu_items = Qnil;
menu_items_inuse = Qnil;
-
- defsubr (&Sx_popup_menu);
- defsubr (&Sx_popup_dialog);
- defsubr (&Smenu_bar_menu_at_x_y);
}