From 481044622937b001ee07a6f8c3f81c1e73ef9eaf Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 10 Jul 2010 14:56:47 -0400 Subject: [PATCH] Adapt terminal frames to latest menu-bar changes. * frame.c (make_frame): Initialize menu_bar_lines and tool_bar_lines members. (make_initial_frame, make_terminal_frame): Initialize menu_bar_lines using value of menu-bar-mode. * msdos.c (IT_set_frame_parameters): Don't set menu-bar-lines. --- src/ChangeLog | 9 +++++++++ src/frame.c | 4 ++++ src/msdos.c | 18 ------------------ 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index a6fb6852c6c..0bd64c2ae72 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2010-07-10 Chong Yidong + + * frame.c (make_frame): Initialize menu_bar_lines and + tool_bar_lines members. + (make_initial_frame, make_terminal_frame): Initialize + menu_bar_lines using value of menu-bar-mode. + + * msdos.c (IT_set_frame_parameters): Don't set menu-bar-lines. + 2010-07-10 Eli Zaretskii * process.c: Reshuffle #include's. Condition some of the global diff --git a/src/frame.c b/src/frame.c index 37d1579dd4d..1bbebcde133 100644 --- a/src/frame.c +++ b/src/frame.c @@ -326,6 +326,8 @@ make_frame (int mini_p) f->n_tool_bar_items = 0; f->left_fringe_width = f->right_fringe_width = 0; f->fringe_cols = 0; + f->menu_bar_lines = 0; + f->tool_bar_lines = 0; f->scroll_bar_actual_width = 0; f->border_width = 0; f->internal_border_width = 0; @@ -550,6 +552,7 @@ make_initial_frame (void) FRAME_CAN_HAVE_SCROLL_BARS (f) = 0; FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none; + FRAME_MENU_BAR_LINES(f) = NILP (Vmenu_bar_mode) ? 0 : 1; #ifdef CANNOT_DUMP if (!noninteractive) @@ -600,6 +603,7 @@ make_terminal_frame (struct terminal *terminal) FRAME_CAN_HAVE_SCROLL_BARS (f) = 0; FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none; + FRAME_MENU_BAR_LINES(f) = NILP (Vmenu_bar_mode) ? 0 : 1; /* Set the top frame to the newly created frame. */ if (FRAMEP (FRAME_TTY (f)->top_frame) diff --git a/src/msdos.c b/src/msdos.c index 668243ef422..c1c838375e6 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -2074,10 +2074,6 @@ IT_set_frame_parameters (struct frame *f, Lisp_Object alist) unsigned long orig_fg, orig_bg; Lisp_Object frame_bg, frame_fg; struct tty_display_info *tty = FRAME_TTY (f); - extern Lisp_Object Qmenu_bar_lines; - extern Lisp_Object Vmenu_bar_mode; - int menu_bar_lines_defined = - !NILP (Fassq (Qmenu_bar_lines, Vdefault_frame_alist)); /* If we are creating a new frame, begin with the original screen colors used for the initial frame. */ @@ -2116,8 +2112,6 @@ IT_set_frame_parameters (struct frame *f, Lisp_Object alist) if (EQ (prop, Qreverse)) reverse = EQ (val, Qt); - else if (!menu_bar_lines_defined && EQ (prop, Qmenu_bar_lines)) - menu_bar_lines_defined = 1; } if (tty->termscript && reverse) @@ -2217,18 +2211,6 @@ IT_set_frame_parameters (struct frame *f, Lisp_Object alist) store_frame_param (f, prop, val); } - /* If menu-bar-lines is neither in the frame parameters nor in - default-frame-alist, set it according to menu-bar-mode. */ - if (!menu_bar_lines_defined) - { - store_frame_param (f, Qmenu_bar_lines, - NILP (Vmenu_bar_mode) - ? make_number (0) : make_number (1)); - if (tty->termscript) - fprintf (tty->termscript, "