summaryrefslogtreecommitdiffstats
path: root/mbbsd/term.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-12-21 20:34:15 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-12-21 20:34:15 +0800
commit355d1dcde948b4226f1f11dfc45952aa6851a176 (patch)
tree9c14f10fa575032aaaae4ff6a33469e1345a51f7 /mbbsd/term.c
parent8649e4efe65373700682ff66e3cbff8b09fcabec (diff)
downloadpttbbs-355d1dcde948b4226f1f11dfc45952aa6851a176.tar
pttbbs-355d1dcde948b4226f1f11dfc45952aa6851a176.tar.gz
pttbbs-355d1dcde948b4226f1f11dfc45952aa6851a176.tar.bz2
pttbbs-355d1dcde948b4226f1f11dfc45952aa6851a176.tar.lz
pttbbs-355d1dcde948b4226f1f11dfc45952aa6851a176.tar.xz
pttbbs-355d1dcde948b4226f1f11dfc45952aa6851a176.tar.zst
pttbbs-355d1dcde948b4226f1f11dfc45952aa6851a176.zip
- refresh screen after changing window size
- fix getdata() clrtoeol issue git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3720 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/term.c')
-rw-r--r--mbbsd/term.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/mbbsd/term.c b/mbbsd/term.c
index bea4ec33..c1f5efd8 100644
--- a/mbbsd/term.c
+++ b/mbbsd/term.c
@@ -40,22 +40,38 @@ sig_term_resize(int sig)
void term_resize(int w, int h)
{
+ char changed = 0;
+ screen_backup_t scr;
+
Signal(SIGWINCH, SIG_IGN); /* Don't bother me! */
+
/* make sure reasonable size */
h = MAX(24, MIN(100, h));
w = MAX(80, MIN(200, w));
- // invoke terminal system resize
- resizeterm(h, w);
+ if (w != t_columns || h != t_lines)
+ {
+ scr_dump(&scr);
+ changed = 1;
+
+ // invoke terminal system resize
+ resizeterm(h, w);
- t_lines = h;
- t_columns = w;
+ t_lines = h;
+ t_columns = w;
+ }
scr_lns = t_lines; /* XXX: scr_lns 跟 t_lines 有什麼不同, 為何分成兩個 */
b_lines = t_lines - 1;
p_lines = t_lines - 4;
Signal(SIGWINCH, sig_term_resize);
+
+ if (changed)
+ {
+ scr_restore(&scr);
+ redrawwin();
+ }
}
int