summaryrefslogtreecommitdiff
path: root/src/fe-text/term-terminfo.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-11-03 14:42:28 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-11-03 14:42:28 +0000
commit25b04419d4b8b0bb907a0d784f5683570035bc15 (patch)
treec77844aeda8ae3633357a7980b12867f80e9ae94 /src/fe-text/term-terminfo.c
parent67a9ad0598bcde5af151938859d61c76ee097b54 (diff)
downloadirssi-25b04419d4b8b0bb907a0d784f5683570035bc15.zip
Reset the color before clearing screen. Set the cursor invisible when moving
around in screen and set it visible again when it's in wanted position. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1964 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text/term-terminfo.c')
-rw-r--r--src/fe-text/term-terminfo.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/fe-text/term-terminfo.c b/src/fe-text/term-terminfo.c
index 88296131..6e462284 100644
--- a/src/fe-text/term-terminfo.c
+++ b/src/fe-text/term-terminfo.c
@@ -37,10 +37,11 @@ struct _TERM_WINDOW {
TERM_WINDOW *root_window;
int term_width, term_height;
-static int vcx, vcy;
+static int vcx, vcy, curs_visible;
static int curs_x, curs_y;
static int last_fg, last_bg, last_attrs;
static int redraw_needed, redraw_tag;
+static int freeze_counter;
/* SIGCONT handler */
static void sig_cont(int p)
@@ -65,7 +66,8 @@ int term_init(void)
last_fg = last_bg = -1;
last_attrs = 0;
- vcx = vcy = -1;
+ vcx = vcy = -1;
+ curs_visible = TRUE;
current_term = terminfo_core_init(stdin, stdout);
if (current_term == NULL)
@@ -134,6 +136,7 @@ void term_force_colors(int set)
void term_clear(void)
{
vcx = vcy = -1;
+ term_set_color(root_window, 0);
terminfo_clear();
}
@@ -264,6 +267,11 @@ void term_move(TERM_WINDOW *window, int x, int y)
{
int newx, newy;
+ if (curs_visible) {
+ terminfo_set_cursor_visible(FALSE);
+ curs_visible = FALSE;
+ }
+
newx = x+window->x;
newy = y+window->y;
if (vcx != newx || vcy != newy) {
@@ -305,17 +313,31 @@ void term_move_cursor(int x, int y)
void term_refresh(TERM_WINDOW *window)
{
+ if (freeze_counter > 0)
+ return;
+
if (vcx != curs_x || vcy != curs_y)
term_move(root_window, curs_x, curs_y);
+ if (!curs_visible) {
+ terminfo_set_cursor_visible(TRUE);
+ curs_visible = TRUE;
+ }
fflush(window != NULL ? window->term->out : current_term->out);
}
void term_refresh_freeze(void)
{
+ freeze_counter++;
+ if (curs_visible) {
+ terminfo_set_cursor_visible(FALSE);
+ curs_visible = FALSE;
+ }
}
void term_refresh_thaw(void)
{
+ if (--freeze_counter == 0)
+ term_refresh(NULL);
}
void term_stop(void)