diff options
| author | Martin Rudalics | 2021-10-22 10:34:49 +0200 |
|---|---|---|
| committer | Martin Rudalics | 2021-10-22 10:34:49 +0200 |
| commit | 938f10c601e87154b697cdb73b44e0d44851303b (patch) | |
| tree | 07d19ba7d588e58a416ddb4c04c742f258840244 | |
| parent | 885448d1e66ba70faf3559e4028552fbb090aef5 (diff) | |
| download | emacs-938f10c601e87154b697cdb73b44e0d44851303b.tar.gz emacs-938f10c601e87154b697cdb73b44e0d44851303b.zip | |
In 'window-text-pixel-size' use actual mode line heights if wanted (Bug#38181)
* src/xdisp.c (Fwindow_text_pixel_size): Run display_mode_line
when MODE_LINES wants it to take actual mode line heights into
account (Bug#38181).
| -rw-r--r-- | src/xdisp.c | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 8eb5b2e4bd4..bbe7e2701ba 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -10847,17 +10847,42 @@ include the height of any of these, if present, in the return value. */) | |||
| 10847 | if (y > max_y) | 10847 | if (y > max_y) |
| 10848 | y = max_y; | 10848 | y = max_y; |
| 10849 | 10849 | ||
| 10850 | if (EQ (mode_lines, Qtab_line) || EQ (mode_lines, Qt)) | 10850 | if ((EQ (mode_lines, Qtab_line) || EQ (mode_lines, Qt)) |
| 10851 | /* Re-add height of tab-line as requested. */ | 10851 | && window_wants_tab_line (w)) |
| 10852 | y = y + WINDOW_TAB_LINE_HEIGHT (w); | 10852 | /* Add height of tab-line as requested. */ |
| 10853 | { | ||
| 10854 | Lisp_Object window_tab_line_format | ||
| 10855 | = window_parameter (w, Qtab_line_format); | ||
| 10856 | |||
| 10857 | y = y + display_mode_line (w, TAB_LINE_FACE_ID, | ||
| 10858 | NILP (window_tab_line_format) | ||
| 10859 | ? BVAR (current_buffer, tab_line_format) | ||
| 10860 | : window_tab_line_format); | ||
| 10861 | } | ||
| 10853 | 10862 | ||
| 10854 | if (EQ (mode_lines, Qheader_line) || EQ (mode_lines, Qt)) | 10863 | if ((EQ (mode_lines, Qheader_line) || EQ (mode_lines, Qt)) |
| 10855 | /* Re-add height of header-line as requested. */ | 10864 | && window_wants_header_line (w)) |
| 10856 | y = y + WINDOW_HEADER_LINE_HEIGHT (w); | 10865 | { |
| 10866 | Lisp_Object window_header_line_format | ||
| 10867 | = window_parameter (w, Qheader_line_format); | ||
| 10857 | 10868 | ||
| 10858 | if (EQ (mode_lines, Qmode_line) || EQ (mode_lines, Qt)) | 10869 | y = y + display_mode_line (w, HEADER_LINE_FACE_ID, |
| 10859 | /* Add height of mode-line as requested. */ | 10870 | NILP (window_header_line_format) |
| 10860 | y = y + WINDOW_MODE_LINE_HEIGHT (w); | 10871 | ? BVAR (current_buffer, header_line_format) |
| 10872 | : window_header_line_format); | ||
| 10873 | } | ||
| 10874 | |||
| 10875 | if ((EQ (mode_lines, Qmode_line) || EQ (mode_lines, Qt)) | ||
| 10876 | && window_wants_mode_line (w)) | ||
| 10877 | { | ||
| 10878 | Lisp_Object window_mode_line_format | ||
| 10879 | = window_parameter (w, Qmode_line_format); | ||
| 10880 | |||
| 10881 | y = y + display_mode_line (w, CURRENT_MODE_LINE_FACE_ID (w), | ||
| 10882 | NILP (window_mode_line_format) | ||
| 10883 | ? BVAR (current_buffer, mode_line_format) | ||
| 10884 | : window_mode_line_format); | ||
| 10885 | } | ||
| 10861 | 10886 | ||
| 10862 | bidi_unshelve_cache (itdata, false); | 10887 | bidi_unshelve_cache (itdata, false); |
| 10863 | 10888 | ||