From: Geoff Voelker Date: Fri, 17 Apr 1998 05:09:51 +0000 (+0000) Subject: (Vmenu_updating_frame): New variable. X-Git-Tag: emacs-20.3~1463 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c88696553221c2e8df18c16b64d7f9e405128d2b;p=emacs.git (Vmenu_updating_frame): New variable. (Fx_popup_menu, set_frame_menubar): Record frame whose menu is being updated. (syms_of_w32menu): Define Vmenu_updating_frame. --- diff --git a/src/w32menu.c b/src/w32menu.c index c078f977081..fe474caa1a6 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -47,6 +47,8 @@ Boston, MA 02111-1307, USA. */ #define min(x, y) (((x) < (y)) ? (x) : (y)) #define max(x, y) (((x) > (y)) ? (x) : (y)) +Lisp_Object Vmenu_updating_frame; + typedef struct menu_map { Lisp_Object menu_items; @@ -1298,8 +1300,11 @@ cached information about equivalent key sequences.") xpos += XINT (x); ypos += XINT (y); + + XSETFRAME (Vmenu_updating_frame, f); } - + Vmenu_updating_frame = Qnil; + title = Qnil; GCPRO1 (title); @@ -1526,6 +1531,8 @@ set_frame_menubar (f, first_time, deep_p) struct buffer *prev = current_buffer; Lisp_Object buffer; + XSETFRAME (Vmenu_updating_frame, f); + /* We must not change the menubar when actually in use. */ if (f->output_data.w32->menubar_active) return; @@ -2141,6 +2148,11 @@ syms_of_w32menu () Qdebug_on_next_call = intern ("debug-on-next-call"); staticpro (&Qdebug_on_next_call); + DEFVAR_LISP ("menu-updating-frame", &Vmenu_updating_frame, + "Frame for which we are updating a menu\n\ +The enable predicate for a menu command should check this variable."); + Vmenu_updating_frame = Qnil; + defsubr (&Sx_popup_menu); defsubr (&Sx_popup_dialog); }