diff options
| author | Martin Rudalics | 2014-08-10 10:26:28 +0200 |
|---|---|---|
| committer | Martin Rudalics | 2014-08-10 10:26:28 +0200 |
| commit | c29f96fa6b074980faea5bd4bddb4c74993838b0 (patch) | |
| tree | 7ad142e338513b12278c4be995843e6c84b27887 /src | |
| parent | aa4008091c9adcc23924983f45eb442f55217056 (diff) | |
| download | emacs-c29f96fa6b074980faea5bd4bddb4c74993838b0.tar.gz emacs-c29f96fa6b074980faea5bd4bddb4c74993838b0.zip | |
Fix handling of menu bar line on TTY frames (Bug#18136) (Bug#18196).
* dispnew.c (handle_window_change_signal):
* keyboard.c (Fsuspend_emacs): Call change_frame_size with
frame's menu bar lines subtracted from height.
* frame.c (frame_inhibit_resize): Inhibit resizing of TTY
frames.
(adjust_frame_size): Count in menu bar when setting FrameRows.
(make_terminal_frame): When setting up the frame's lines and
text height don't count in the menu bar.
(Fmake_terminal_frame): Call adjust_frame_size with menu bar
lines subtracted from height.
(do_switch_frame): Set tty's FrameRows to number of total lines
of frame.
(Fframe_pixel_height, Fframe_pixel_width): If no window system
is used, return total number of lines and columns.
* menu.c (emulate_dialog_with_menu): Use FRAME_TOTAL_LINES instead
of FRAME_LINES.
* term.c (OUTPUT, tty_set_terminal_modes)
(tty_set_terminal_window, tty_set_scroll_region)
(tty_clear_to_end, tty_write_glyphs, tty_write_glyphs_with_face)
(tty_ins_del_lines, tty_menu_display, tty_menu_activate): Use
FRAME_TOTAL_LINES instead of FRAME_LINES.
(Fresume_tty): Use FRAME_TOTAL_LINES instead of FRAME_LINES.
Call change_frame_size with frame's menu bar lines subtracted
from height.
* w32console.c (w32con_clear_to_end, w32con_clear_frame)
(w32con_ins_del_lines): Use FRAME_TOTAL_LINES instead of
FRAME_LINES.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 32 | ||||
| -rw-r--r-- | src/dispnew.c | 4 | ||||
| -rw-r--r-- | src/frame.c | 17 | ||||
| -rw-r--r-- | src/keyboard.c | 7 | ||||
| -rw-r--r-- | src/menu.c | 2 | ||||
| -rw-r--r-- | src/term.c | 31 | ||||
| -rw-r--r-- | src/w32console.c | 10 |
7 files changed, 71 insertions, 32 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 52862bfb446..fb941916c45 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,35 @@ | |||
| 1 | 2014-08-10 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | Fix handling of menu bar line on TTY frames (Bug#18136) | ||
| 4 | (Bug#18196). | ||
| 5 | * dispnew.c (handle_window_change_signal): | ||
| 6 | * keyboard.c (Fsuspend_emacs): Call change_frame_size with | ||
| 7 | frame's menu bar lines subtracted from height. | ||
| 8 | * frame.c (frame_inhibit_resize): Inhibit resizing of TTY | ||
| 9 | frames. | ||
| 10 | (adjust_frame_size): Count in menu bar when setting FrameRows. | ||
| 11 | (make_terminal_frame): When setting up the frame's lines and | ||
| 12 | text height don't count in the menu bar. | ||
| 13 | (Fmake_terminal_frame): Call adjust_frame_size with menu bar | ||
| 14 | lines subtracted from height. | ||
| 15 | (do_switch_frame): Set tty's FrameRows to number of total lines | ||
| 16 | of frame. | ||
| 17 | (Fframe_pixel_height, Fframe_pixel_width): If no window system | ||
| 18 | is used, return total number of lines and columns. | ||
| 19 | * menu.c (emulate_dialog_with_menu): Use FRAME_TOTAL_LINES instead | ||
| 20 | of FRAME_LINES. | ||
| 21 | * term.c (OUTPUT, tty_set_terminal_modes) | ||
| 22 | (tty_set_terminal_window, tty_set_scroll_region) | ||
| 23 | (tty_clear_to_end, tty_write_glyphs, tty_write_glyphs_with_face) | ||
| 24 | (tty_ins_del_lines, tty_menu_display, tty_menu_activate): Use | ||
| 25 | FRAME_TOTAL_LINES instead of FRAME_LINES. | ||
| 26 | (Fresume_tty): Use FRAME_TOTAL_LINES instead of FRAME_LINES. | ||
| 27 | Call change_frame_size with frame's menu bar lines subtracted | ||
| 28 | from height. | ||
| 29 | * w32console.c (w32con_clear_to_end, w32con_clear_frame) | ||
| 30 | (w32con_ins_del_lines): Use FRAME_TOTAL_LINES instead of | ||
| 31 | FRAME_LINES. | ||
| 32 | |||
| 1 | 2014-08-09 Reuben Thomas <rrt@sc3d.org> | 33 | 2014-08-09 Reuben Thomas <rrt@sc3d.org> |
| 2 | 34 | ||
| 3 | * alloc.c (Fmemory_info): Remove a stray brace. | 35 | * alloc.c (Fmemory_info): Remove a stray brace. |
diff --git a/src/dispnew.c b/src/dispnew.c index 0e49530c71d..b587852fc6e 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -5444,7 +5444,9 @@ handle_window_change_signal (int sig) | |||
| 5444 | /* Record the new sizes, but don't reallocate the data | 5444 | /* Record the new sizes, but don't reallocate the data |
| 5445 | structures now. Let that be done later outside of the | 5445 | structures now. Let that be done later outside of the |
| 5446 | signal handler. */ | 5446 | signal handler. */ |
| 5447 | change_frame_size (XFRAME (frame), width, height, 0, 1, 0, 0); | 5447 | change_frame_size (XFRAME (frame), width, |
| 5448 | height - FRAME_MENU_BAR_LINES (XFRAME (frame)), | ||
| 5449 | 0, 1, 0, 0); | ||
| 5448 | } | 5450 | } |
| 5449 | } | 5451 | } |
| 5450 | } | 5452 | } |
diff --git a/src/frame.c b/src/frame.c index c72b474512f..6051b671cf3 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -215,7 +215,8 @@ frame_inhibit_resize (struct frame *f, bool horizontal) | |||
| 215 | { | 215 | { |
| 216 | 216 | ||
| 217 | return (frame_inhibit_implied_resize | 217 | return (frame_inhibit_implied_resize |
| 218 | || !NILP (get_frame_param (f, Qfullscreen))); | 218 | || !NILP (get_frame_param (f, Qfullscreen)) |
| 219 | || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)); | ||
| 219 | } | 220 | } |
| 220 | 221 | ||
| 221 | #if 0 | 222 | #if 0 |
| @@ -563,7 +564,7 @@ adjust_frame_size (struct frame *f, int new_width, int new_height, int inhibit, | |||
| 563 | /* MSDOS frames cannot PRETEND, as they change frame size by | 564 | /* MSDOS frames cannot PRETEND, as they change frame size by |
| 564 | manipulating video hardware. */ | 565 | manipulating video hardware. */ |
| 565 | if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f)) | 566 | if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f)) |
| 566 | FrameRows (FRAME_TTY (f)) = new_lines; | 567 | FrameRows (FRAME_TTY (f)) = new_lines + FRAME_TOP_MARGIN (f); |
| 567 | } | 568 | } |
| 568 | 569 | ||
| 569 | /* Assign new sizes. */ | 570 | /* Assign new sizes. */ |
| @@ -917,7 +918,9 @@ make_terminal_frame (struct terminal *terminal) | |||
| 917 | #endif | 918 | #endif |
| 918 | 919 | ||
| 919 | FRAME_MENU_BAR_LINES (f) = NILP (Vmenu_bar_mode) ? 0 : 1; | 920 | FRAME_MENU_BAR_LINES (f) = NILP (Vmenu_bar_mode) ? 0 : 1; |
| 921 | FRAME_LINES (f) = FRAME_LINES (f) - FRAME_MENU_BAR_LINES (f); | ||
| 920 | FRAME_MENU_BAR_HEIGHT (f) = FRAME_MENU_BAR_LINES (f) * FRAME_LINE_HEIGHT (f); | 922 | FRAME_MENU_BAR_HEIGHT (f) = FRAME_MENU_BAR_LINES (f) * FRAME_LINE_HEIGHT (f); |
| 923 | FRAME_TEXT_HEIGHT (f) = FRAME_TEXT_HEIGHT (f) - FRAME_MENU_BAR_HEIGHT (f); | ||
| 921 | 924 | ||
| 922 | /* Set the top frame to the newly created frame. */ | 925 | /* Set the top frame to the newly created frame. */ |
| 923 | if (FRAMEP (FRAME_TTY (f)->top_frame) | 926 | if (FRAMEP (FRAME_TTY (f)->top_frame) |
| @@ -1037,7 +1040,7 @@ affects all frames on the same terminal device. */) | |||
| 1037 | { | 1040 | { |
| 1038 | int width, height; | 1041 | int width, height; |
| 1039 | get_tty_size (fileno (FRAME_TTY (f)->input), &width, &height); | 1042 | get_tty_size (fileno (FRAME_TTY (f)->input), &width, &height); |
| 1040 | adjust_frame_size (f, width, height, 5, 0); | 1043 | adjust_frame_size (f, width, height - FRAME_MENU_BAR_LINES (f), 5, 0); |
| 1041 | } | 1044 | } |
| 1042 | 1045 | ||
| 1043 | adjust_frame_glyphs (f); | 1046 | adjust_frame_glyphs (f); |
| @@ -1168,8 +1171,8 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor | |||
| 1168 | frame's data. */ | 1171 | frame's data. */ |
| 1169 | if (FRAME_COLS (f) != FrameCols (tty)) | 1172 | if (FRAME_COLS (f) != FrameCols (tty)) |
| 1170 | FrameCols (tty) = FRAME_COLS (f); | 1173 | FrameCols (tty) = FRAME_COLS (f); |
| 1171 | if (FRAME_LINES (f) != FrameRows (tty)) | 1174 | if (FRAME_TOTAL_LINES (f) != FrameRows (tty)) |
| 1172 | FrameRows (tty) = FRAME_LINES (f); | 1175 | FrameRows (tty) = FRAME_TOTAL_LINES (f); |
| 1173 | } | 1176 | } |
| 1174 | tty->top_frame = frame; | 1177 | tty->top_frame = frame; |
| 1175 | } | 1178 | } |
| @@ -2733,7 +2736,7 @@ to `frame-height'). */) | |||
| 2733 | return make_number (FRAME_PIXEL_HEIGHT (f)); | 2736 | return make_number (FRAME_PIXEL_HEIGHT (f)); |
| 2734 | else | 2737 | else |
| 2735 | #endif | 2738 | #endif |
| 2736 | return make_number (FRAME_LINES (f)); | 2739 | return make_number (FRAME_TOTAL_LINES (f)); |
| 2737 | } | 2740 | } |
| 2738 | 2741 | ||
| 2739 | DEFUN ("frame-pixel-width", Fframe_pixel_width, | 2742 | DEFUN ("frame-pixel-width", Fframe_pixel_width, |
| @@ -2750,7 +2753,7 @@ If FRAME is omitted or nil, the selected frame is used. */) | |||
| 2750 | return make_number (FRAME_PIXEL_WIDTH (f)); | 2753 | return make_number (FRAME_PIXEL_WIDTH (f)); |
| 2751 | else | 2754 | else |
| 2752 | #endif | 2755 | #endif |
| 2753 | return make_number (FRAME_COLS (f)); | 2756 | return make_number (FRAME_TOTAL_COLS (f)); |
| 2754 | } | 2757 | } |
| 2755 | 2758 | ||
| 2756 | DEFUN ("tool-bar-pixel-width", Ftool_bar_pixel_width, | 2759 | DEFUN ("tool-bar-pixel-width", Ftool_bar_pixel_width, |
diff --git a/src/keyboard.c b/src/keyboard.c index 8a6385301c4..9b0b19ada2f 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1868,7 +1868,7 @@ static Lisp_Object | |||
| 1868 | safe_run_hooks_error (Lisp_Object error, ptrdiff_t nargs, Lisp_Object *args) | 1868 | safe_run_hooks_error (Lisp_Object error, ptrdiff_t nargs, Lisp_Object *args) |
| 1869 | { | 1869 | { |
| 1870 | Lisp_Object hook, fun, msgargs[4]; | 1870 | Lisp_Object hook, fun, msgargs[4]; |
| 1871 | 1871 | ||
| 1872 | eassert (nargs == 2); | 1872 | eassert (nargs == 2); |
| 1873 | hook = args[0]; | 1873 | hook = args[0]; |
| 1874 | fun = args[1]; | 1874 | fun = args[1]; |
| @@ -10221,8 +10221,9 @@ On such systems, Emacs starts a subshell instead of suspending. */) | |||
| 10221 | with a window system; but suspend should be disabled in that case. */ | 10221 | with a window system; but suspend should be disabled in that case. */ |
| 10222 | get_tty_size (fileno (CURTTY ()->input), &width, &height); | 10222 | get_tty_size (fileno (CURTTY ()->input), &width, &height); |
| 10223 | if (width != old_width || height != old_height) | 10223 | if (width != old_width || height != old_height) |
| 10224 | change_frame_size (SELECTED_FRAME (), width, height | 10224 | change_frame_size (SELECTED_FRAME (), width, |
| 10225 | - FRAME_MENU_BAR_LINES (SELECTED_FRAME ()), 0, 0, 0, 0); | 10225 | height - FRAME_MENU_BAR_LINES (SELECTED_FRAME ()), |
| 10226 | 0, 0, 0, 0); | ||
| 10226 | 10227 | ||
| 10227 | /* Run suspend-resume-hook. */ | 10228 | /* Run suspend-resume-hook. */ |
| 10228 | hook = intern ("suspend-resume-hook"); | 10229 | hook = intern ("suspend-resume-hook"); |
diff --git a/src/menu.c b/src/menu.c index e0f226562f8..66247c713a2 100644 --- a/src/menu.c +++ b/src/menu.c | |||
| @@ -1455,7 +1455,7 @@ emulate_dialog_with_menu (struct frame *f, Lisp_Object contents) | |||
| 1455 | their upper-left corner at the given position.) */ | 1455 | their upper-left corner at the given position.) */ |
| 1456 | if (STRINGP (prompt)) | 1456 | if (STRINGP (prompt)) |
| 1457 | x_coord -= SCHARS (prompt); | 1457 | x_coord -= SCHARS (prompt); |
| 1458 | y_coord = FRAME_LINES (f); | 1458 | y_coord = FRAME_TOTAL_LINES (f); |
| 1459 | } | 1459 | } |
| 1460 | 1460 | ||
| 1461 | XSETFRAME (frame, f); | 1461 | XSETFRAME (frame, f); |
diff --git a/src/term.c b/src/term.c index 8c004ccbecb..9afd3b872b0 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -91,7 +91,7 @@ static _Noreturn void vfatal (const char *str, va_list ap) | |||
| 91 | 91 | ||
| 92 | #define OUTPUT(tty, a) \ | 92 | #define OUTPUT(tty, a) \ |
| 93 | emacs_tputs ((tty), a, \ | 93 | emacs_tputs ((tty), a, \ |
| 94 | FRAME_LINES (XFRAME (selected_frame)) - curY (tty), \ | 94 | FRAME_TOTAL_LINES (XFRAME (selected_frame)) - curY (tty), \ |
| 95 | cmputc) | 95 | cmputc) |
| 96 | 96 | ||
| 97 | #define OUTPUT1(tty, a) emacs_tputs ((tty), a, 1, cmputc) | 97 | #define OUTPUT1(tty, a) emacs_tputs ((tty), a, 1, cmputc) |
| @@ -201,7 +201,7 @@ tty_set_terminal_modes (struct terminal *terminal) | |||
| 201 | off the screen, so it won't be overwritten and lost. */ | 201 | off the screen, so it won't be overwritten and lost. */ |
| 202 | int i; | 202 | int i; |
| 203 | current_tty = tty; | 203 | current_tty = tty; |
| 204 | for (i = 0; i < FRAME_LINES (XFRAME (selected_frame)); i++) | 204 | for (i = 0; i < FRAME_TOTAL_LINES (XFRAME (selected_frame)); i++) |
| 205 | cmputc ('\n'); | 205 | cmputc ('\n'); |
| 206 | } | 206 | } |
| 207 | 207 | ||
| @@ -257,7 +257,7 @@ tty_set_terminal_window (struct frame *f, int size) | |||
| 257 | { | 257 | { |
| 258 | struct tty_display_info *tty = FRAME_TTY (f); | 258 | struct tty_display_info *tty = FRAME_TTY (f); |
| 259 | 259 | ||
| 260 | tty->specified_window = size ? size : FRAME_LINES (f); | 260 | tty->specified_window = size ? size : FRAME_TOTAL_LINES (f); |
| 261 | if (FRAME_SCROLL_REGION_OK (f)) | 261 | if (FRAME_SCROLL_REGION_OK (f)) |
| 262 | tty_set_scroll_region (f, 0, tty->specified_window); | 262 | tty_set_scroll_region (f, 0, tty->specified_window); |
| 263 | } | 263 | } |
| @@ -272,9 +272,9 @@ tty_set_scroll_region (struct frame *f, int start, int stop) | |||
| 272 | buf = tparam (tty->TS_set_scroll_region, 0, 0, start, stop - 1, 0, 0); | 272 | buf = tparam (tty->TS_set_scroll_region, 0, 0, start, stop - 1, 0, 0); |
| 273 | else if (tty->TS_set_scroll_region_1) | 273 | else if (tty->TS_set_scroll_region_1) |
| 274 | buf = tparam (tty->TS_set_scroll_region_1, 0, 0, | 274 | buf = tparam (tty->TS_set_scroll_region_1, 0, 0, |
| 275 | FRAME_LINES (f), start, | 275 | FRAME_TOTAL_LINES (f), start, |
| 276 | FRAME_LINES (f) - stop, | 276 | FRAME_TOTAL_LINES (f) - stop, |
| 277 | FRAME_LINES (f)); | 277 | FRAME_TOTAL_LINES (f)); |
| 278 | else | 278 | else |
| 279 | buf = tparam (tty->TS_set_window, 0, 0, start, 0, stop, FRAME_COLS (f)); | 279 | buf = tparam (tty->TS_set_window, 0, 0, start, 0, stop, FRAME_COLS (f)); |
| 280 | 280 | ||
| @@ -446,7 +446,7 @@ tty_clear_to_end (struct frame *f) | |||
| 446 | } | 446 | } |
| 447 | else | 447 | else |
| 448 | { | 448 | { |
| 449 | for (i = curY (tty); i < FRAME_LINES (f); i++) | 449 | for (i = curY (tty); i < FRAME_TOTAL_LINES (f); i++) |
| 450 | { | 450 | { |
| 451 | cursor_to (f, i, 0); | 451 | cursor_to (f, i, 0); |
| 452 | clear_end_of_line (f, FRAME_COLS (f)); | 452 | clear_end_of_line (f, FRAME_COLS (f)); |
| @@ -748,7 +748,7 @@ tty_write_glyphs (struct frame *f, struct glyph *string, int len) | |||
| 748 | since that would scroll the whole frame on some terminals. */ | 748 | since that would scroll the whole frame on some terminals. */ |
| 749 | 749 | ||
| 750 | if (AutoWrap (tty) | 750 | if (AutoWrap (tty) |
| 751 | && curY (tty) + 1 == FRAME_LINES (f) | 751 | && curY (tty) + 1 == FRAME_TOTAL_LINES (f) |
| 752 | && (curX (tty) + len) == FRAME_COLS (f)) | 752 | && (curX (tty) + len) == FRAME_COLS (f)) |
| 753 | len --; | 753 | len --; |
| 754 | if (len <= 0) | 754 | if (len <= 0) |
| @@ -820,7 +820,7 @@ tty_write_glyphs_with_face (register struct frame *f, register struct glyph *str | |||
| 820 | since that would scroll the whole frame on some terminals. */ | 820 | since that would scroll the whole frame on some terminals. */ |
| 821 | 821 | ||
| 822 | if (AutoWrap (tty) | 822 | if (AutoWrap (tty) |
| 823 | && curY (tty) + 1 == FRAME_LINES (f) | 823 | && curY (tty) + 1 == FRAME_TOTAL_LINES (f) |
| 824 | && (curX (tty) + len) == FRAME_COLS (f)) | 824 | && (curX (tty) + len) == FRAME_COLS (f)) |
| 825 | len --; | 825 | len --; |
| 826 | if (len <= 0) | 826 | if (len <= 0) |
| @@ -1009,7 +1009,7 @@ tty_ins_del_lines (struct frame *f, int vpos, int n) | |||
| 1009 | && vpos + i >= tty->specified_window) | 1009 | && vpos + i >= tty->specified_window) |
| 1010 | return; | 1010 | return; |
| 1011 | if (!FRAME_MEMORY_BELOW_FRAME (f) | 1011 | if (!FRAME_MEMORY_BELOW_FRAME (f) |
| 1012 | && vpos + i >= FRAME_LINES (f)) | 1012 | && vpos + i >= FRAME_TOTAL_LINES (f)) |
| 1013 | return; | 1013 | return; |
| 1014 | 1014 | ||
| 1015 | if (multi) | 1015 | if (multi) |
| @@ -1046,7 +1046,7 @@ tty_ins_del_lines (struct frame *f, int vpos, int n) | |||
| 1046 | && FRAME_MEMORY_BELOW_FRAME (f) | 1046 | && FRAME_MEMORY_BELOW_FRAME (f) |
| 1047 | && n < 0) | 1047 | && n < 0) |
| 1048 | { | 1048 | { |
| 1049 | cursor_to (f, FRAME_LINES (f) + n, 0); | 1049 | cursor_to (f, FRAME_TOTAL_LINES (f) + n, 0); |
| 1050 | clear_to_end (f); | 1050 | clear_to_end (f); |
| 1051 | } | 1051 | } |
| 1052 | } | 1052 | } |
| @@ -2405,13 +2405,14 @@ frame's terminal). */) | |||
| 2405 | struct frame *f = XFRAME (t->display_info.tty->top_frame); | 2405 | struct frame *f = XFRAME (t->display_info.tty->top_frame); |
| 2406 | int width, height; | 2406 | int width, height; |
| 2407 | int old_height = FRAME_COLS (f); | 2407 | int old_height = FRAME_COLS (f); |
| 2408 | int old_width = FRAME_LINES (f); | 2408 | int old_width = FRAME_TOTAL_LINES (f); |
| 2409 | 2409 | ||
| 2410 | /* Check if terminal/window size has changed while the frame | 2410 | /* Check if terminal/window size has changed while the frame |
| 2411 | was suspended. */ | 2411 | was suspended. */ |
| 2412 | get_tty_size (fileno (t->display_info.tty->input), &width, &height); | 2412 | get_tty_size (fileno (t->display_info.tty->input), &width, &height); |
| 2413 | if (width != old_width || height != old_height) | 2413 | if (width != old_width || height != old_height) |
| 2414 | change_frame_size (f, width, height - FRAME_MENU_BAR_LINES (f), 0, 0, 0, 0); | 2414 | change_frame_size (f, width, height - FRAME_MENU_BAR_LINES (f), |
| 2415 | 0, 0, 0, 0); | ||
| 2415 | SET_FRAME_VISIBLE (XFRAME (t->display_info.tty->top_frame), 1); | 2416 | SET_FRAME_VISIBLE (XFRAME (t->display_info.tty->top_frame), 1); |
| 2416 | } | 2417 | } |
| 2417 | 2418 | ||
| @@ -2894,7 +2895,7 @@ tty_menu_display (tty_menu *menu, int x, int y, int pn, int *faces, | |||
| 2894 | /* Don't try to display more menu items than the console can display | 2895 | /* Don't try to display more menu items than the console can display |
| 2895 | using the available screen lines. Exclude the echo area line, as | 2896 | using the available screen lines. Exclude the echo area line, as |
| 2896 | it will be overwritten by the help-echo anyway. */ | 2897 | it will be overwritten by the help-echo anyway. */ |
| 2897 | int max_items = min (menu->count - first_item, FRAME_LINES (sf) - 1 - y); | 2898 | int max_items = min (menu->count - first_item, FRAME_TOTAL_LINES (sf) - 1 - y); |
| 2898 | 2899 | ||
| 2899 | menu_help_message = NULL; | 2900 | menu_help_message = NULL; |
| 2900 | 2901 | ||
| @@ -3274,7 +3275,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx, | |||
| 3274 | { | 3275 | { |
| 3275 | mi_result input_status; | 3276 | mi_result input_status; |
| 3276 | int min_y = state[0].y; | 3277 | int min_y = state[0].y; |
| 3277 | int max_y = min (min_y + state[0].menu->count, FRAME_LINES (sf) - 1) - 1; | 3278 | int max_y = min (min_y + state[0].menu->count, FRAME_TOTAL_LINES (sf) - 1) - 1; |
| 3278 | 3279 | ||
| 3279 | input_status = read_menu_input (sf, &x, &y, min_y, max_y, &first_time); | 3280 | input_status = read_menu_input (sf, &x, &y, min_y, max_y, &first_time); |
| 3280 | if (input_status) | 3281 | if (input_status) |
diff --git a/src/w32console.c b/src/w32console.c index 98f68145191..82a7c041900 100644 --- a/src/w32console.c +++ b/src/w32console.c | |||
| @@ -118,7 +118,7 @@ static void | |||
| 118 | w32con_clear_to_end (struct frame *f) | 118 | w32con_clear_to_end (struct frame *f) |
| 119 | { | 119 | { |
| 120 | w32con_clear_end_of_line (f, FRAME_COLS (f) - 1); | 120 | w32con_clear_end_of_line (f, FRAME_COLS (f) - 1); |
| 121 | w32con_ins_del_lines (f, cursor_coords.Y, FRAME_LINES (f) - cursor_coords.Y - 1); | 121 | w32con_ins_del_lines (f, cursor_coords.Y, FRAME_TOTAL_LINES (f) - cursor_coords.Y - 1); |
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | /* Clear the frame. */ | 124 | /* Clear the frame. */ |
| @@ -133,7 +133,7 @@ w32con_clear_frame (struct frame *f) | |||
| 133 | GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE), &info); | 133 | GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE), &info); |
| 134 | 134 | ||
| 135 | /* Remember that the screen buffer might be wider than the window. */ | 135 | /* Remember that the screen buffer might be wider than the window. */ |
| 136 | n = FRAME_LINES (f) * info.dwSize.X; | 136 | n = FRAME_TOTAL_LINES (f) * info.dwSize.X; |
| 137 | dest.X = dest.Y = 0; | 137 | dest.X = dest.Y = 0; |
| 138 | 138 | ||
| 139 | FillConsoleOutputAttribute (cur_screen, char_attr_normal, n, dest, &r); | 139 | FillConsoleOutputAttribute (cur_screen, char_attr_normal, n, dest, &r); |
| @@ -175,18 +175,18 @@ w32con_ins_del_lines (struct frame *f, int vpos, int n) | |||
| 175 | if (n < 0) | 175 | if (n < 0) |
| 176 | { | 176 | { |
| 177 | scroll.Top = vpos - n; | 177 | scroll.Top = vpos - n; |
| 178 | scroll.Bottom = FRAME_LINES (f); | 178 | scroll.Bottom = FRAME_TOTAL_LINES (f); |
| 179 | dest.Y = vpos; | 179 | dest.Y = vpos; |
| 180 | } | 180 | } |
| 181 | else | 181 | else |
| 182 | { | 182 | { |
| 183 | scroll.Top = vpos; | 183 | scroll.Top = vpos; |
| 184 | scroll.Bottom = FRAME_LINES (f) - n; | 184 | scroll.Bottom = FRAME_TOTAL_LINES (f) - n; |
| 185 | dest.Y = vpos + n; | 185 | dest.Y = vpos + n; |
| 186 | } | 186 | } |
| 187 | clip.Top = clip.Left = scroll.Left = 0; | 187 | clip.Top = clip.Left = scroll.Left = 0; |
| 188 | clip.Right = scroll.Right = FRAME_COLS (f); | 188 | clip.Right = scroll.Right = FRAME_COLS (f); |
| 189 | clip.Bottom = FRAME_LINES (f); | 189 | clip.Bottom = FRAME_TOTAL_LINES (f); |
| 190 | 190 | ||
| 191 | dest.X = 0; | 191 | dest.X = 0; |
| 192 | 192 | ||