diff options
| author | Martin Rudalics | 2015-03-03 11:32:19 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2015-03-03 11:32:19 +0100 |
| commit | 1903e25c17a0dce03710143659c0fa9e9c6d6494 (patch) | |
| tree | 91d44d9ae771f4720de9e0775bd282637dbb3fbc | |
| parent | 2cc23f170f920cbfc9df4c28bce6ca9d82c4e6cd (diff) | |
| download | emacs-1903e25c17a0dce03710143659c0fa9e9c6d6494.tar.gz emacs-1903e25c17a0dce03710143659c0fa9e9c6d6494.zip | |
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.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/window.el | 2 | ||||
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/frame.c | 5 |
4 files changed, 18 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index aae09fda38f..16206e2b6e1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2015-03-03 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * window.el (window--dump-frame): For pixel height return total | ||
| 4 | number of frame's lines. | ||
| 5 | |||
| 1 | 2015-03-03 Daniel Colascione <dancol@dancol.org> | 6 | 2015-03-03 Daniel Colascione <dancol@dancol.org> |
| 2 | 7 | ||
| 3 | * emacs-lisp/cl-macs.el (cl-iter-defun): Add cl-iter-defun. | 8 | * 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." | |||
| 1160 | (insert | 1160 | (insert |
| 1161 | (format "frame pixel: %s x %s cols/lines: %s x %s units: %s x %s\n" | 1161 | (format "frame pixel: %s x %s cols/lines: %s x %s units: %s x %s\n" |
| 1162 | (frame-pixel-width frame) (frame-pixel-height frame) | 1162 | (frame-pixel-width frame) (frame-pixel-height frame) |
| 1163 | (frame-total-cols frame) (frame-text-lines frame) ; (frame-total-lines frame) | 1163 | (frame-total-cols frame) (frame-total-lines frame) |
| 1164 | (frame-char-width frame) (frame-char-height frame)) | 1164 | (frame-char-width frame) (frame-char-height frame)) |
| 1165 | (format "frame text pixel: %s x %s cols/lines: %s x %s\n" | 1165 | (format "frame text pixel: %s x %s cols/lines: %s x %s\n" |
| 1166 | (frame-text-width frame) (frame-text-height frame) | 1166 | (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 @@ | |||
| 1 | 2015-03-03 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * frame.c (adjust_frame_size): If the pixel sizes remain | ||
| 4 | unchanged but the number of lines or columns of the frame | ||
| 5 | changes, run `window--pixel-to-total' (Bug#19972). | ||
| 6 | (Qwindow_pixel_to_total): DEFSYM it. | ||
| 7 | |||
| 1 | 2015-03-03 Daniel Colascione <dancol@dancol.org> | 8 | 2015-03-03 Daniel Colascione <dancol@dancol.org> |
| 2 | 9 | ||
| 3 | * print.c (print_object): Print whether a finalizer has | 10 | * 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, | |||
| 537 | } | 537 | } |
| 538 | #endif | 538 | #endif |
| 539 | } | 539 | } |
| 540 | else if (new_cols != old_cols) | ||
| 541 | call2 (Qwindow_pixel_to_total, frame, Qt); | ||
| 540 | 542 | ||
| 541 | if (new_windows_height != old_windows_height | 543 | if (new_windows_height != old_windows_height |
| 542 | /* When the top margin has changed we have to recalculate the top | 544 | /* 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, | |||
| 551 | if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f)) | 553 | if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f)) |
| 552 | FrameRows (FRAME_TTY (f)) = new_lines + FRAME_TOP_MARGIN (f); | 554 | FrameRows (FRAME_TTY (f)) = new_lines + FRAME_TOP_MARGIN (f); |
| 553 | } | 555 | } |
| 556 | else if (new_lines != old_lines) | ||
| 557 | call2 (Qwindow_pixel_to_total, frame, Qnil); | ||
| 554 | 558 | ||
| 555 | frame_size_history_add | 559 | frame_size_history_add |
| 556 | (f, Qadjust_frame_size_3, new_text_width, new_text_height, | 560 | (f, Qadjust_frame_size_3, new_text_width, new_text_height, |
| @@ -4831,6 +4835,7 @@ syms_of_frame (void) | |||
| 4831 | DEFSYM (Qframep, "framep"); | 4835 | DEFSYM (Qframep, "framep"); |
| 4832 | DEFSYM (Qframe_live_p, "frame-live-p"); | 4836 | DEFSYM (Qframe_live_p, "frame-live-p"); |
| 4833 | DEFSYM (Qframe_windows_min_size, "frame-windows-min-size"); | 4837 | DEFSYM (Qframe_windows_min_size, "frame-windows-min-size"); |
| 4838 | DEFSYM (Qwindow_pixel_to_total, "window--pixel-to-total"); | ||
| 4834 | DEFSYM (Qexplicit_name, "explicit-name"); | 4839 | DEFSYM (Qexplicit_name, "explicit-name"); |
| 4835 | DEFSYM (Qheight, "height"); | 4840 | DEFSYM (Qheight, "height"); |
| 4836 | DEFSYM (Qicon, "icon"); | 4841 | DEFSYM (Qicon, "icon"); |