# HG changeset patch # User Dan Nicolaescu # Date 1233359127 0 # Node ID 1009d5607716b7e636b6f04173a47a5f3812ce81 # Parent 697627d7bedae689f8401baa115b5c39c61d933f * dispnew.c (window_change_signal): Don't try to get the size of a suspended tty frame. * term.c (Fresume_tty): Resize if the size has changed while the tty was suspended. diff -r 697627d7beda -r 1009d5607716 src/ChangeLog --- a/src/ChangeLog Fri Jan 30 23:43:20 2009 +0000 +++ b/src/ChangeLog Fri Jan 30 23:45:27 2009 +0000 @@ -1,5 +1,10 @@ 2009-01-30 Dan Nicolaescu + * dispnew.c (window_change_signal): Don't try to get the size of a + suspended tty frame. + * term.c (Fresume_tty): Resize if the size has changed while the + tty was suspended. + * alloc.c (mark_stack): Properly conditionalize previous change. 2009-01-30 Juanma Barranquero diff -r 697627d7beda -r 1009d5607716 src/dispnew.c --- a/src/dispnew.c Fri Jan 30 23:43:20 2009 +0000 +++ b/src/dispnew.c Fri Jan 30 23:45:27 2009 +0000 @@ -6218,6 +6218,11 @@ if (! tty->term_initted) continue; + /* Suspended tty frames have tty->input == NULL avoid trying to + use it. */ + if (!tty->input) + continue; + get_tty_size (fileno (tty->input), &width, &height); if (width > 5 && height > 2) { diff -r 697627d7beda -r 1009d5607716 src/term.c --- a/src/term.c Fri Jan 30 23:43:20 2009 +0000 +++ b/src/term.c Fri Jan 30 23:45:27 2009 +0000 @@ -2470,7 +2470,19 @@ #endif if (FRAMEP (t->display_info.tty->top_frame)) - FRAME_SET_VISIBLE (XFRAME (t->display_info.tty->top_frame), 1); + { + struct frame *f = XFRAME (t->display_info.tty->top_frame); + int width, height; + int old_height = FRAME_COLS (f); + int old_width = FRAME_LINES (f); + + /* Check if terminal/window size has changed while the frame + was suspended. */ + get_tty_size (fileno (t->display_info.tty->input), &width, &height); + if (width != old_width || height != old_height) + change_frame_size (f, height, width, 0, 0, 0); + FRAME_SET_VISIBLE (XFRAME (t->display_info.tty->top_frame), 1); + } init_sys_modes (t->display_info.tty);