summaryrefslogtreecommitdiffstats
path: root/mbbsd
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
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')
-rw-r--r--mbbsd/io.c1
-rw-r--r--mbbsd/talk.c2
-rw-r--r--mbbsd/term.c24
3 files changed, 22 insertions, 5 deletions
diff --git a/mbbsd/io.c b/mbbsd/io.c
index 6916322a..17eb837b 100644
--- a/mbbsd/io.c
+++ b/mbbsd/io.c
@@ -700,6 +700,7 @@ oldgetdata(int line, int col, const char *prompt, char *buf, int len, int echo)
// workaround poor terminal
move_ansi(line, col);
getyx(&line, &col);
+ clrtoeol();
// (line, col) are real starting address
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index e431f43a..c19768b0 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -3092,7 +3092,7 @@ t_idle(void)
currutmp->destuid = idle_type;
do {
move(b_lines - 2, 0);
- clrtoeol();
+ clrtobot();
prints("(鎖定螢幕)發呆原因: %s", (idle_type != 6) ?
IdleTypeTable[idle_type] : idle_reason);
refresh();
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