From 1903e25c17a0dce03710143659c0fa9e9c6d6494 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Tue, 3 Mar 2015 11:32:19 +0100 Subject: [PATCH] Fix calculation of total window sizes after font size changes (Bug#19972). * frame.c (adjust_frame_size): If the pixel sizes remain unchanged but the number of lines or columns of the frame changes, run `window--pixel-to-total' (Bug#19972). (Qwindow_pixel_to_total): DEFSYM it. * window.el (window--dump-frame): For pixel height return total number of frame's lines. --- lisp/ChangeLog | 5 +++++ lisp/window.el | 2 +- src/ChangeLog | 7 +++++++ src/frame.c | 5 +++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index aae09fda38f..16206e2b6e1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-03-03 Martin Rudalics + + * window.el (window--dump-frame): For pixel height return total + number of frame's lines. + 2015-03-03 Daniel Colascione * emacs-lisp/cl-macs.el (cl-iter-defun): Add cl-iter-defun. diff --git a/lisp/window.el b/lisp/window.el index abc60063ab9..cc8a7fc402f 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -1160,7 +1160,7 @@ dumping to it." (insert (format "frame pixel: %s x %s cols/lines: %s x %s units: %s x %s\n" (frame-pixel-width frame) (frame-pixel-height frame) - (frame-total-cols frame) (frame-text-lines frame) ; (frame-total-lines frame) + (frame-total-cols frame) (frame-total-lines frame) (frame-char-width frame) (frame-char-height frame)) (format "frame text pixel: %s x %s cols/lines: %s x %s\n" (frame-text-width frame) (frame-text-height frame) diff --git a/src/ChangeLog b/src/ChangeLog index 930a33b277a..f1bdd150905 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2015-03-03 Martin Rudalics + + * frame.c (adjust_frame_size): If the pixel sizes remain + unchanged but the number of lines or columns of the frame + changes, run `window--pixel-to-total' (Bug#19972). + (Qwindow_pixel_to_total): DEFSYM it. + 2015-03-03 Daniel Colascione * print.c (print_object): Print whether a finalizer has diff --git a/src/frame.c b/src/frame.c index 4a526e228f9..bac2b246ad9 100644 --- a/src/frame.c +++ b/src/frame.c @@ -537,6 +537,8 @@ adjust_frame_size (struct frame *f, int new_width, int new_height, int inhibit, } #endif } + else if (new_cols != old_cols) + call2 (Qwindow_pixel_to_total, frame, Qt); if (new_windows_height != old_windows_height /* When the top margin has changed we have to recalculate the top @@ -551,6 +553,8 @@ adjust_frame_size (struct frame *f, int new_width, int new_height, int inhibit, if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f)) FrameRows (FRAME_TTY (f)) = new_lines + FRAME_TOP_MARGIN (f); } + else if (new_lines != old_lines) + call2 (Qwindow_pixel_to_total, frame, Qnil); frame_size_history_add (f, Qadjust_frame_size_3, new_text_width, new_text_height, @@ -4831,6 +4835,7 @@ syms_of_frame (void) DEFSYM (Qframep, "framep"); DEFSYM (Qframe_live_p, "frame-live-p"); DEFSYM (Qframe_windows_min_size, "frame-windows-min-size"); + DEFSYM (Qwindow_pixel_to_total, "window--pixel-to-total"); DEFSYM (Qexplicit_name, "explicit-name"); DEFSYM (Qheight, "height"); DEFSYM (Qicon, "icon"); -- 2.39.2