diff options
| author | Geoff Voelker | 1998-04-17 05:09:51 +0000 |
|---|---|---|
| committer | Geoff Voelker | 1998-04-17 05:09:51 +0000 |
| commit | c88696553221c2e8df18c16b64d7f9e405128d2b (patch) | |
| tree | b1ab50678782f8d6504a6edfb4cc4e51b13c16f2 /src | |
| parent | c0f1b02e2be15bc48072adb419e48dfbaf0965af (diff) | |
| download | emacs-c88696553221c2e8df18c16b64d7f9e405128d2b.tar.gz emacs-c88696553221c2e8df18c16b64d7f9e405128d2b.zip | |
(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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32menu.c | 14 |
1 files changed, 13 insertions, 1 deletions
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. */ | |||
| 47 | #define min(x, y) (((x) < (y)) ? (x) : (y)) | 47 | #define min(x, y) (((x) < (y)) ? (x) : (y)) |
| 48 | #define max(x, y) (((x) > (y)) ? (x) : (y)) | 48 | #define max(x, y) (((x) > (y)) ? (x) : (y)) |
| 49 | 49 | ||
| 50 | Lisp_Object Vmenu_updating_frame; | ||
| 51 | |||
| 50 | typedef struct menu_map | 52 | typedef struct menu_map |
| 51 | { | 53 | { |
| 52 | Lisp_Object menu_items; | 54 | Lisp_Object menu_items; |
| @@ -1298,8 +1300,11 @@ cached information about equivalent key sequences.") | |||
| 1298 | 1300 | ||
| 1299 | xpos += XINT (x); | 1301 | xpos += XINT (x); |
| 1300 | ypos += XINT (y); | 1302 | ypos += XINT (y); |
| 1303 | |||
| 1304 | XSETFRAME (Vmenu_updating_frame, f); | ||
| 1301 | } | 1305 | } |
| 1302 | 1306 | Vmenu_updating_frame = Qnil; | |
| 1307 | |||
| 1303 | title = Qnil; | 1308 | title = Qnil; |
| 1304 | GCPRO1 (title); | 1309 | GCPRO1 (title); |
| 1305 | 1310 | ||
| @@ -1526,6 +1531,8 @@ set_frame_menubar (f, first_time, deep_p) | |||
| 1526 | struct buffer *prev = current_buffer; | 1531 | struct buffer *prev = current_buffer; |
| 1527 | Lisp_Object buffer; | 1532 | Lisp_Object buffer; |
| 1528 | 1533 | ||
| 1534 | XSETFRAME (Vmenu_updating_frame, f); | ||
| 1535 | |||
| 1529 | /* We must not change the menubar when actually in use. */ | 1536 | /* We must not change the menubar when actually in use. */ |
| 1530 | if (f->output_data.w32->menubar_active) | 1537 | if (f->output_data.w32->menubar_active) |
| 1531 | return; | 1538 | return; |
| @@ -2141,6 +2148,11 @@ syms_of_w32menu () | |||
| 2141 | Qdebug_on_next_call = intern ("debug-on-next-call"); | 2148 | Qdebug_on_next_call = intern ("debug-on-next-call"); |
| 2142 | staticpro (&Qdebug_on_next_call); | 2149 | staticpro (&Qdebug_on_next_call); |
| 2143 | 2150 | ||
| 2151 | DEFVAR_LISP ("menu-updating-frame", &Vmenu_updating_frame, | ||
| 2152 | "Frame for which we are updating a menu\n\ | ||
| 2153 | The enable predicate for a menu command should check this variable."); | ||
| 2154 | Vmenu_updating_frame = Qnil; | ||
| 2155 | |||
| 2144 | defsubr (&Sx_popup_menu); | 2156 | defsubr (&Sx_popup_menu); |
| 2145 | defsubr (&Sx_popup_dialog); | 2157 | defsubr (&Sx_popup_dialog); |
| 2146 | } | 2158 | } |