diff options
| author | Eli Zaretskii | 2014-06-30 19:45:38 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2014-06-30 19:45:38 +0300 |
| commit | 1e23f9f308be761ca3b1bb992c7983a4585d9174 (patch) | |
| tree | e05ae6ff8a1c6e8858c97babe8806cf31393e6f9 /src | |
| parent | becc9e3c3f8b6df40f159eb01a89d5c7374fa23d (diff) | |
| download | emacs-1e23f9f308be761ca3b1bb992c7983a4585d9174.tar.gz emacs-1e23f9f308be761ca3b1bb992c7983a4585d9174.zip | |
Fix bug #17875 with changing TTY frame size, then selecting new frame.
src/frame.c (do_switch_frame): When switching to another TTY frame,
make sure FrameCols and FrameRows are in sync with the new frame's
data.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/frame.c | 16 |
2 files changed, 19 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index eac62eef7a7..6d1e23b40fd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2014-06-30 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * frame.c (do_switch_frame): When switching to another TTY frame, | ||
| 4 | make sure FrameCols and FrameRows are in sync with the new frame's | ||
| 5 | data. (Bug#17875) | ||
| 6 | |||
| 1 | 2014-06-28 Andreas Schwab <schwab@linux-m68k.org> | 7 | 2014-06-28 Andreas Schwab <schwab@linux-m68k.org> |
| 2 | 8 | ||
| 3 | * coding.c (encode_coding_utf_8): Correctly count produced_chars | 9 | * coding.c (encode_coding_utf_8): Correctly count produced_chars |
diff --git a/src/frame.c b/src/frame.c index 35c926ce7ef..0c130164352 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -46,6 +46,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 46 | #ifdef HAVE_WINDOW_SYSTEM | 46 | #ifdef HAVE_WINDOW_SYSTEM |
| 47 | #include "fontset.h" | 47 | #include "fontset.h" |
| 48 | #endif | 48 | #endif |
| 49 | #include "cm.h" | ||
| 49 | #ifdef MSDOS | 50 | #ifdef MSDOS |
| 50 | #include "msdos.h" | 51 | #include "msdos.h" |
| 51 | #include "dosfns.h" | 52 | #include "dosfns.h" |
| @@ -851,7 +852,9 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor | |||
| 851 | 852 | ||
| 852 | if (FRAME_TERMCAP_P (XFRAME (frame)) || FRAME_MSDOS_P (XFRAME (frame))) | 853 | if (FRAME_TERMCAP_P (XFRAME (frame)) || FRAME_MSDOS_P (XFRAME (frame))) |
| 853 | { | 854 | { |
| 854 | Lisp_Object top_frame = FRAME_TTY (XFRAME (frame))->top_frame; | 855 | struct frame *f = XFRAME (frame); |
| 856 | struct tty_display_info *tty = FRAME_TTY (f); | ||
| 857 | Lisp_Object top_frame = tty->top_frame; | ||
| 855 | 858 | ||
| 856 | /* Don't mark the frame garbaged and/or obscured if we are | 859 | /* Don't mark the frame garbaged and/or obscured if we are |
| 857 | switching to the frame that is already the top frame of that | 860 | switching to the frame that is already the top frame of that |
| @@ -861,9 +864,16 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor | |||
| 861 | if (FRAMEP (top_frame)) | 864 | if (FRAMEP (top_frame)) |
| 862 | /* Mark previously displayed frame as now obscured. */ | 865 | /* Mark previously displayed frame as now obscured. */ |
| 863 | SET_FRAME_VISIBLE (XFRAME (top_frame), 2); | 866 | SET_FRAME_VISIBLE (XFRAME (top_frame), 2); |
| 864 | SET_FRAME_VISIBLE (XFRAME (frame), 1); | 867 | SET_FRAME_VISIBLE (f, 1); |
| 868 | /* If the new TTY frame changed dimensions, we need to | ||
| 869 | resync term.c's idea of the frame size with the new | ||
| 870 | frame's data. */ | ||
| 871 | if (FRAME_COLS (f) != FrameCols (tty)) | ||
| 872 | FrameCols (tty) = FRAME_COLS (f); | ||
| 873 | if (FRAME_LINES (f) != FrameRows (tty)) | ||
| 874 | FrameRows (tty) = FRAME_LINES (f); | ||
| 865 | } | 875 | } |
| 866 | FRAME_TTY (XFRAME (frame))->top_frame = frame; | 876 | tty->top_frame = frame; |
| 867 | } | 877 | } |
| 868 | 878 | ||
| 869 | selected_frame = frame; | 879 | selected_frame = frame; |