summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-10-22 21:19:04 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-10-22 21:19:04 +0800
commit9ae23edd57a7f190bae1f512e2ef1108d3bb4d6b (patch)
treeb593692e2b5120ea9f063b023c59685833e69144
parent7fcc93c85bd2931bc8a5c8ee4d71a8cb48c32109 (diff)
downloadpttbbs-9ae23edd57a7f190bae1f512e2ef1108d3bb4d6b.tar
pttbbs-9ae23edd57a7f190bae1f512e2ef1108d3bb4d6b.tar.gz
pttbbs-9ae23edd57a7f190bae1f512e2ef1108d3bb4d6b.tar.bz2
pttbbs-9ae23edd57a7f190bae1f512e2ef1108d3bb4d6b.tar.lz
pttbbs-9ae23edd57a7f190bae1f512e2ef1108d3bb4d6b.tar.xz
pttbbs-9ae23edd57a7f190bae1f512e2ef1108d3bb4d6b.tar.zst
pttbbs-9ae23edd57a7f190bae1f512e2ef1108d3bb4d6b.zip
* fix scr_restore when scrolling
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@4955 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/include/pttstruct.h1
-rw-r--r--pttbbs/mbbsd/ccw.c26
-rw-r--r--pttbbs/mbbsd/screen.c10
3 files changed, 20 insertions, 17 deletions
diff --git a/pttbbs/include/pttstruct.h b/pttbbs/include/pttstruct.h
index 7d8664a6..7014cca6 100644
--- a/pttbbs/include/pttstruct.h
+++ b/pttbbs/include/pttstruct.h
@@ -424,6 +424,7 @@ typedef struct water_t {
typedef struct {
int row, col;
int y, x;
+ int roll; // for scrolling
void *raw_memory;
} screen_backup_t;
diff --git a/pttbbs/mbbsd/ccw.c b/pttbbs/mbbsd/ccw.c
index dedadaf8..1d482ede 100644
--- a/pttbbs/mbbsd/ccw.c
+++ b/pttbbs/mbbsd/ccw.c
@@ -509,11 +509,14 @@ ccw_talk_peek_key(CCW_CTX *ctx, int key)
{
VREFSCR scr = vscr_save();
add_io(0, 0);
+
if (vans("�T�w�n�����Ѷ�? [y/N]: ") == 'y')
ctx->abort = YEA;
- vscr_restore(scr);
+
add_io(ctx->fd, 0);
- ccw_footer(ctx);
+ vscr_restore(scr);
+
+ // ccw_footer(ctx);
}
// notify remote user
if (ctx->abort)
@@ -673,7 +676,9 @@ ccw_chat_footer(CCW_CTX *ctx)
// process ZA
VREFSCR scr = vscr_save();
add_io(0, 0);
+
ZA_Enter();
+
add_io(ctx->fd, 0);
vscr_restore(scr);
}
@@ -920,11 +925,14 @@ ccw_chat_peek_key(CCW_CTX *ctx, int key)
{
VREFSCR scr = vscr_save();
add_io(0, 0);
+
if (vans("�T�w�n�����Ѷ�? [y/N]: ") == 'y')
ctx->abort = YEA;
- vscr_restore(scr);
+
add_io(ctx->fd, 0);
- ccw_footer(ctx);
+ vscr_restore(scr);
+
+ // ccw_footer(ctx);
}
// notify remote user
if (ctx->abort)
@@ -935,9 +943,11 @@ ccw_chat_peek_key(CCW_CTX *ctx, int key)
{
VREFSCR scr = vscr_save();
add_io(0, 0);
+
t_idle();
- vscr_restore(scr);
+
add_io(ctx->fd, 0);
+ vscr_restore(scr);
}
return 1;
@@ -951,12 +961,8 @@ ccw_chat_peek_key(CCW_CTX *ctx, int key)
fflush(ctx->log);
more(ctx->log_fpath, YEA);
- vscr_restore(scr);
add_io(ctx->fd, 0);
-#ifndef USE_PFTERM
- // XXX screen is buggy when dealing with scroll...
- ccw_reset_scr(ctx);
-#endif
+ vscr_restore(scr);
}
return 1;
diff --git a/pttbbs/mbbsd/screen.c b/pttbbs/mbbsd/screen.c
index 3926938b..3ad79bb8 100644
--- a/pttbbs/mbbsd/screen.c
+++ b/pttbbs/mbbsd/screen.c
@@ -814,9 +814,7 @@ void scr_dump(screen_backup_t *old)
old->col = t_columns;
old->row = t_lines;
- // FIXME unfortunately, scrolling does not work...
- // - example: chat, page_up, down, left (back)
- // old->scroll = scrollcnt;
+ old->roll = roll;
getyx(&old->y, &old->x);
for(i = 0; i < t_lines; i++) {
@@ -838,10 +836,8 @@ void scr_restore(const screen_backup_t *old)
screenline_t* bp = big_picture;
const int len = MIN(old->row, t_lines);
- // FIXME unfortunately, scrolling does not work...
- // - example: chat, page_up, down, left (back)
- // scrollcnt = old->scroll;
- // docls = YEA;
+ // XXX simple step to solve scrolling issue...
+ roll = old->roll;
for(i = 0; i < len; i++) {
/* restore header */