changeset 21612:24a01af0cd38

(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.
author Geoff Voelker <voelker@cs.washington.edu>
date Fri, 17 Apr 1998 05:09:51 +0000
parents 1a4fc4d9ca9a
children fe4f5bfae371
files src/w32menu.c
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32menu.c	Fri Apr 17 05:09:29 1998 +0000
+++ b/src/w32menu.c	Fri Apr 17 05:09:51 1998 +0000
@@ -47,6 +47,8 @@
 #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 @@
       
       xpos += XINT (x);
       ypos += XINT (y);
+
+      XSETFRAME (Vmenu_updating_frame, f);
     }
-  
+  Vmenu_updating_frame = Qnil;
+
   title = Qnil;
   GCPRO1 (title);
   
@@ -1526,6 +1531,8 @@
   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 @@
   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);
 }