changeset 109117:240177dc47d7

Fix menu bar display on MS-DOS. msdos.c (IT_set_frame_parameters): Set menu-bar-lines according to menu-bar-mode, if not set in the frame parameters or in default-frame-alist.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 03 Jul 2010 14:54:21 +0300
parents e723dd7c9121
children 254d81c0e750
files src/ChangeLog src/msdos.c
diffstat 2 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sat Jul 03 10:49:55 2010 +0300
+++ b/src/ChangeLog	Sat Jul 03 14:54:21 2010 +0300
@@ -1,5 +1,9 @@
 2010-07-03  Eli Zaretskii  <eliz@gnu.org>
 
+	* msdos.c (IT_set_frame_parameters): Set menu-bar-lines according
+	to menu-bar-mode, if not set in the frame parameters or in
+	default-frame-alist.
+
 	* w32console.c (sys_tputs): Adjust argument list to prototype in
 	term.c.
 
--- a/src/msdos.c	Sat Jul 03 10:49:55 2010 +0300
+++ b/src/msdos.c	Sat Jul 03 14:54:21 2010 +0300
@@ -2098,6 +2098,10 @@
   Lisp_Object frame_bg, frame_fg;
   extern Lisp_Object Qdefault, QCforeground, QCbackground;
   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.  */
@@ -2144,6 +2148,8 @@
 
       if (EQ (prop, Qreverse))
 	reverse = EQ (val, Qt);
+      else if (!menu_bar_lines_defined && EQ (prop, Qmenu_bar_lines))
+	menu_bar_lines_defined = 1;
     }
 
   need_to_reverse = reverse && !was_reverse;
@@ -2226,6 +2232,18 @@
       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, "<MENU BAR LINES DEFAULTED: %d\n",
+		 !NILP (Vmenu_bar_mode));
+    }
+
   /* If they specified "reverse", but not the colors, we need to swap
      the current frame colors.  */
   if (need_to_reverse)