Date: Sat, 12 Sep 2009 08:19:24 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r197114 - head/sys/teken Message-ID: <200909120819.n8C8JOqT079103@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Sat Sep 12 08:19:24 2009 New Revision: 197114 URL: http://svn.freebsd.org/changeset/base/197114 Log: Make resizing of teken terminals a bit more safe. Just perform a full reset when resizing the terminal. This means the cursor, scrolling region, etc. are never positioned outside the terminal. Modified: head/sys/teken/teken.c head/sys/teken/teken_subr.h Modified: head/sys/teken/teken.c ============================================================================== --- head/sys/teken/teken.c Sat Sep 12 05:39:51 2009 (r197113) +++ head/sys/teken/teken.c Sat Sep 12 08:19:24 2009 (r197114) @@ -341,10 +341,7 @@ teken_set_winsize(teken_t *t, const teke { t->t_winsize = *p; - /* XXX: bounds checking with cursor/etc! */ - t->t_scrollreg.ts_begin = 0; - t->t_scrollreg.ts_end = t->t_winsize.tp_row; - t->t_originreg = t->t_scrollreg; + teken_subr_do_reset(t); } /* Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Sat Sep 12 05:39:51 2009 (r197113) +++ head/sys/teken/teken_subr.h Sat Sep 12 08:19:24 2009 (r197114) @@ -927,6 +927,9 @@ teken_subr_do_reset(teken_t *t) t->t_curattr = t->t_defattr; t->t_cursor.tp_row = t->t_cursor.tp_col = 0; + t->t_scrollreg.ts_begin = 0; + t->t_scrollreg.ts_end = t->t_winsize.tp_row; + t->t_originreg = t->t_scrollreg; t->t_stateflags = TS_AUTOWRAP; teken_scs_set(t, 0, teken_scs_us_ascii);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909120819.n8C8JOqT079103>