aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-04-14 09:06:25 +0000
committerRichard M. Stallman1994-04-14 09:06:25 +0000
commitecf7de9bebb2074dc291a6072b1db924e528529e (patch)
treea33afbdb904838eb982a6fbb2f2090e4f2b12bf1
parente69e8fad9b51b2e5f071127c20ee3bb3dc73b0f6 (diff)
downloademacs-ecf7de9bebb2074dc291a6072b1db924e528529e.tar.gz
emacs-ecf7de9bebb2074dc291a6072b1db924e528529e.zip
(update_menu_bar): Take frame as arg.
(update_menu_bars): Function deleted. (prepare_menu_bars): Call update_menu_bar; do it for all frames. Simplify computation of all_windows; ignore irrelevant criteria.
-rw-r--r--src/xdisp.c72
1 files changed, 13 insertions, 59 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 85a7f968c95..fe981183e47 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -450,25 +450,8 @@ prepare_menu_bars ()
450 frame_garbaged = 0; 450 frame_garbaged = 0;
451 } 451 }
452 452
453 if (clip_changed || windows_or_buffers_changed) 453 all_windows = (update_mode_lines || buffer_shared > 1
454 update_mode_lines++; 454 || clip_changed || windows_or_buffers_changed);
455
456 /* Detect case that we need to write a star in the mode line. */
457 if (XFASTINT (w->last_modified) < MODIFF
458 && XFASTINT (w->last_modified) <= current_buffer->save_modified)
459 {
460 w->update_mode_line = Qt;
461 if (buffer_shared > 1)
462 update_mode_lines++;
463 }
464
465 all_windows = update_mode_lines || buffer_shared > 1;
466
467 /* If specs for an arrow have changed, do thorough redisplay
468 to ensure we remove any arrow that should no longer exist. */
469 if (! EQ (Voverlay_arrow_position, last_arrow_position)
470 || ! EQ (Voverlay_arrow_string, last_arrow_string))
471 all_windows = 1, clip_changed = 1;
472 455
473 /* Update the menu bar item lists, if appropriate. 456 /* Update the menu bar item lists, if appropriate.
474 This has to be done before any actual redisplay 457 This has to be done before any actual redisplay
@@ -478,15 +461,10 @@ prepare_menu_bars ()
478 Lisp_Object tail, frame; 461 Lisp_Object tail, frame;
479 462
480 FOR_EACH_FRAME (tail, frame) 463 FOR_EACH_FRAME (tail, frame)
481 { 464 update_menu_bar (XFRAME (frame));
482 FRAME_PTR f = XFRAME (frame);
483
484 if (FRAME_VISIBLE_P (f))
485 update_menu_bars (FRAME_ROOT_WINDOW (f));
486 }
487 } 465 }
488 else if (FRAME_VISIBLE_P (selected_frame)) 466 else
489 update_menu_bar (selected_window); 467 update_menu_bar (selected_frame);
490} 468}
491 469
492/* Do a frame update, taking possible shortcuts into account. 470/* Do a frame update, taking possible shortcuts into account.
@@ -932,43 +910,19 @@ mark_window_display_accurate (window, flag)
932 } 910 }
933} 911}
934 912
935/* Update the menu bar item lists for WINDOW 913/* Update the menu bar item list for frame F.
936 and its subwindows and siblings.
937 This has to be done before we start to fill in any display lines, 914 This has to be done before we start to fill in any display lines,
938 because it can call eval. */ 915 because it can call eval. */
939 916
940static void 917static void
941update_menu_bars (window) 918update_menu_bar (f)
942 Lisp_Object window; 919 FRAME_PTR f;
943{
944 for (; !NILP (window); window = XWINDOW (window)->next)
945 update_menu_bar (window);
946}
947
948/* Update the menu bar item list for window WINDOW and its subwindows. */
949
950static void
951update_menu_bar (window)
952 Lisp_Object window;
953{ 920{
954 register struct window *w = XWINDOW (window);
955 struct buffer *old = current_buffer; 921 struct buffer *old = current_buffer;
956 FRAME_PTR f = XFRAME (WINDOW_FRAME (w)); 922 Lisp_Object window;
957 923 register struct window *w;
958 /* If this is a combination window, do its children; that's all. */ 924 window = FRAME_SELECTED_WINDOW (f);
959 925 w = XWINDOW (window);
960 if (!NILP (w->vchild))
961 {
962 update_menu_bars (w->vchild);
963 return;
964 }
965 if (!NILP (w->hchild))
966 {
967 update_menu_bars (w->hchild);
968 return;
969 }
970 if (NILP (w->buffer))
971 abort ();
972 926
973 if (update_mode_lines) 927 if (update_mode_lines)
974 w->update_mode_line = Qt; 928 w->update_mode_line = Qt;
@@ -980,7 +934,7 @@ update_menu_bar (window)
980#else 934#else
981 && FRAME_MENU_BAR_LINES (f) > 0 935 && FRAME_MENU_BAR_LINES (f) > 0
982#endif 936#endif
983 && EQ (FRAME_SELECTED_WINDOW (f), window)) 937 )
984 { 938 {
985 /* If the user has switched buffers or windows, we need to 939 /* If the user has switched buffers or windows, we need to
986 recompute to reflect the new bindings. But we'll 940 recompute to reflect the new bindings. But we'll