diff src/xmenu.c @ 16656:9cbbf721b91c

(Vmenu_updating_frame): New variable. (syms_of_xmenu): Set up Lisp var. (Fx_popup_menu, set_frame_menubar): Initialize it.
author Richard M. Stallman <rms@gnu.org>
date Tue, 10 Dec 1996 23:25:14 +0000
parents 939831bf2103
children d5e92ecd4595
line wrap: on
line diff
--- a/src/xmenu.c	Tue Dec 10 07:26:02 1996 +0000
+++ b/src/xmenu.c	Tue Dec 10 23:25:14 1996 +0000
@@ -86,6 +86,8 @@
 #define FALSE 0
 #endif /* no TRUE */
 
+Lisp_Object Vmenu_updating_frame;
+
 Lisp_Object Qdebug_on_next_call;
 
 Lisp_Object Qmenu_alias;
@@ -856,7 +858,10 @@
 
       xpos += XINT (x);
       ypos += XINT (y);
+
+      XSETFRAME (Vmenu_updating_frame, f);
     }
+  Vmenu_updating_frame = Qnil;
 #endif /* HAVE_MENUS */
 
   title = Qnil;
@@ -1618,6 +1623,8 @@
   int i;
   LWLIB_ID id;
 
+  XSETFRAME (Vmenu_updating_frame, f);
+
   if (f->output_data.x->id == 0)
     f->output_data.x->id = next_menubar_widget_id++;
   id = f->output_data.x->id;
@@ -2708,6 +2715,11 @@
   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;
+
 #ifdef USE_X_TOOLKIT
   widget_id_tick = (1<<16);	
   next_menubar_widget_id = 1;