* src/window.c (window_scroll_margin): Use window_box_height to avoid
counting header line, scrollbars for scroll-margin limit (Bug #5718).
if (scroll_margin > 0)
{
int frame_line_height = default_line_pixel_height (window);
- int window_total_lines
- = window->total_lines * WINDOW_FRAME_LINE_HEIGHT (window)
- / frame_line_height;
- int margin = min (scroll_margin, window_total_lines / 4);
+ int window_lines = window_box_height (window) / frame_line_height;
+ int margin = min (scroll_margin, window_lines / 4);
if (unit == MARGIN_IN_PIXELS)
return margin * frame_line_height;
else