diff options
| author | Richard M. Stallman | 1996-07-31 16:54:23 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-07-31 16:54:23 +0000 |
| commit | a9be683969176860404ca36ab0514556e2b76dd6 (patch) | |
| tree | 4562a992a427def9e531f2e3eea13d15b0249a3b /src | |
| parent | 0a43f75b23fd38f9c74cd93e092ff6d7f68f459f (diff) | |
| download | emacs-a9be683969176860404ca36ab0514556e2b76dd6.tar.gz emacs-a9be683969176860404ca36ab0514556e2b76dd6.zip | |
(pending_menu_activation): Don't initialize. Not static.
(set_frame_menubar): If no saved_menu_event yet, set deep_p.
Don't clear pending_menu_activation here.
(Fx_popup_dialog): Don't fail to initialize WINDOW.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xmenu.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/xmenu.c b/src/xmenu.c index 2cb381a0fa8..d043ca2dfd3 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -172,7 +172,14 @@ static int popup_activated_flag; | |||
| 172 | 172 | ||
| 173 | static int next_menubar_widget_id; | 173 | static int next_menubar_widget_id; |
| 174 | 174 | ||
| 175 | static int pending_menu_activation = 1; | 175 | /* This is set nonzero after the user activates the menu bar, and set |
| 176 | to zero again after the menu bars are redisplayed by prepare_menu_bar. | ||
| 177 | While it is nonzero, all calls to set_frame_menubar go deep. | ||
| 178 | |||
| 179 | I don't understand why this is needed, but it does seem to be | ||
| 180 | needed on Motif, according to Marcus Daniels <marcus@sysc.pdx.edu>. */ | ||
| 181 | |||
| 182 | int pending_menu_activation; | ||
| 176 | 183 | ||
| 177 | #ifdef USE_X_TOOLKIT | 184 | #ifdef USE_X_TOOLKIT |
| 178 | 185 | ||
| @@ -1007,6 +1014,8 @@ on the left of the dialog box and all following items on the right.\n\ | |||
| 1007 | } | 1014 | } |
| 1008 | else if (WINDOWP (position) || FRAMEP (position)) | 1015 | else if (WINDOWP (position) || FRAMEP (position)) |
| 1009 | window = position; | 1016 | window = position; |
| 1017 | else | ||
| 1018 | window = Qnil; | ||
| 1010 | 1019 | ||
| 1011 | /* Decode where to put the menu. */ | 1020 | /* Decode where to put the menu. */ |
| 1012 | 1021 | ||
| @@ -1184,13 +1193,14 @@ x_activate_menubar (f) | |||
| 1184 | if (!f->output_data.x->saved_menu_event->type) | 1193 | if (!f->output_data.x->saved_menu_event->type) |
| 1185 | return; | 1194 | return; |
| 1186 | 1195 | ||
| 1187 | if (f->output_data.x->saved_menu_event->type != ButtonRelease) | 1196 | set_frame_menubar (f, 0, 1); |
| 1188 | set_frame_menubar (f, 0, 1); | ||
| 1189 | BLOCK_INPUT; | 1197 | BLOCK_INPUT; |
| 1190 | XtDispatchEvent ((XEvent *) f->output_data.x->saved_menu_event); | 1198 | XtDispatchEvent ((XEvent *) f->output_data.x->saved_menu_event); |
| 1191 | UNBLOCK_INPUT; | 1199 | UNBLOCK_INPUT; |
| 1200 | #ifdef USE_MOTIF | ||
| 1192 | if (f->output_data.x->saved_menu_event->type == ButtonRelease) | 1201 | if (f->output_data.x->saved_menu_event->type == ButtonRelease) |
| 1193 | pending_menu_activation = 1; | 1202 | pending_menu_activation = 1; |
| 1203 | #endif | ||
| 1194 | 1204 | ||
| 1195 | /* Ignore this if we get it a second time. */ | 1205 | /* Ignore this if we get it a second time. */ |
| 1196 | f->output_data.x->saved_menu_event->type = 0; | 1206 | f->output_data.x->saved_menu_event->type = 0; |
| @@ -1607,9 +1617,13 @@ set_frame_menubar (f, first_time, deep_p) | |||
| 1607 | if (! menubar_widget) | 1617 | if (! menubar_widget) |
| 1608 | deep_p = 1; | 1618 | deep_p = 1; |
| 1609 | else if (pending_menu_activation && !deep_p) | 1619 | else if (pending_menu_activation && !deep_p) |
| 1620 | deep_p = 1; | ||
| 1621 | /* Make the first call for any given frame always go deep. */ | ||
| 1622 | else if (!f->output_data.x->saved_menu_event && !deep_p) | ||
| 1610 | { | 1623 | { |
| 1611 | deep_p = 1; | 1624 | deep_p = 1; |
| 1612 | pending_menu_activation = 0; | 1625 | f->output_data.x->saved_menu_event = (XEvent*)xmalloc (sizeof (XEvent)); |
| 1626 | f->output_data.x->saved_menu_event->type = 0; | ||
| 1613 | } | 1627 | } |
| 1614 | 1628 | ||
| 1615 | wv = xmalloc_widget_value (); | 1629 | wv = xmalloc_widget_value (); |