aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/frame.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/frame.c b/src/frame.c
index 9b560808128..9eac242ea3f 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -342,7 +342,9 @@ DEFUN ("frame-windows-min-size", Fframe_windows_min_size,
342 * of `window-min-height' (`window-min-width' if HORIZONTAL is non-nil). 342 * of `window-min-height' (`window-min-width' if HORIZONTAL is non-nil).
343 * With IGNORE non-nil the values of these variables are ignored. 343 * With IGNORE non-nil the values of these variables are ignored.
344 * 344 *
345 * In either case, never return a value less than 1. 345 * In either case, never return a value less than 1. For TTY frames,
346 * additionally limit the minimum frame height to a value large enough
347 * to support the menu bar, the mode line, and the echo area.
346 */ 348 */
347static int 349static int
348frame_windows_min_size (Lisp_Object frame, Lisp_Object horizontal, 350frame_windows_min_size (Lisp_Object frame, Lisp_Object horizontal,
@@ -350,6 +352,7 @@ frame_windows_min_size (Lisp_Object frame, Lisp_Object horizontal,
350{ 352{
351 struct frame *f = XFRAME (frame); 353 struct frame *f = XFRAME (frame);
352 Lisp_Object par_size; 354 Lisp_Object par_size;
355 int retval;
353 356
354 if ((!NILP (horizontal) 357 if ((!NILP (horizontal)
355 && NUMBERP (par_size = get_frame_param (f, Qmin_width))) 358 && NUMBERP (par_size = get_frame_param (f, Qmin_width)))
@@ -362,15 +365,27 @@ frame_windows_min_size (Lisp_Object frame, Lisp_Object horizontal,
362 if (min_size < 1) 365 if (min_size < 1)
363 min_size = 1; 366 min_size = 1;
364 367
365 return (NILP (pixelwise) 368 retval = (NILP (pixelwise)
366 ? min_size 369 ? min_size
367 : min_size * (NILP (horizontal) 370 : min_size * (NILP (horizontal)
368 ? FRAME_LINE_HEIGHT (f) 371 ? FRAME_LINE_HEIGHT (f)
369 : FRAME_COLUMN_WIDTH (f))); 372 : FRAME_COLUMN_WIDTH (f)));
370 } 373 }
371 else 374 else
372 return XINT (call4 (Qframe_windows_min_size, frame, horizontal, 375 retval = XINT (call4 (Qframe_windows_min_size, frame, horizontal,
373 ignore, pixelwise)); 376 ignore, pixelwise));
377 /* Don't allow too small height of text-mode frames, or else cm.c
378 might abort in cmcheckmagic. */
379 if ((FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) && NILP (horizontal))
380 {
381 int min_height = (FRAME_MENU_BAR_LINES (f)
382 + FRAME_WANTS_MODELINE_P (f)
383 + 2); /* one text line and one echo-area line */
384 if (retval < min_height)
385 retval = min_height;
386 }
387
388 return retval;
374} 389}
375 390
376 391