diff src/msdos.c @ 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 a5fcd78ad3eb
children 254d81c0e750
line wrap: on
line diff
--- 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)