diff options
author | Nalin Dahyabhai <nalin@src.gnome.org> | 2002-07-13 03:59:23 +0000 |
---|---|---|
committer | Nalin Dahyabhai <nalin@src.gnome.org> | 2002-07-13 03:59:23 +0000 |
commit | 23ec5d4ce4b38d19e9271463563fc94b587e5f93 (patch) | |
tree | f7fdbb9816c4e0852856238c57f88484efa4e963 | |
parent | a7b29e6c2d897a8ccf8feb4523a63c6690221228 (diff) |
Small optimization in the al() and dl() handlers. al() doesn't move the
* src/vte.c: Small optimization in the al() and dl() handlers. al() doesn't
move the cursor, per GNU termcap docs. Check for a pixbuf in the bgfx
check instead of pixmap, which was the wrong type.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/slowcat.c | 3 | ||||
-rw-r--r-- | src/vte.c | 20 |
3 files changed, 16 insertions, 11 deletions
@@ -1,4 +1,8 @@ 2002-07-12 nalin + * src/vte.c: Small optimization in the al() and dl() handlers. al() + doesn't move the cursor, per GNU termcap docs. Check for a pixbuf in + the bgfx check instead of pixmap, which was the wrong type. +2002-07-12 nalin * src/vte.c: Add patch to heed Xft/fontconfig settings as kept by GTK. Based on patch from otaylor. 2002-07-12 nalin diff --git a/src/slowcat.c b/src/slowcat.c index d67af00..775e20d 100644 --- a/src/slowcat.c +++ b/src/slowcat.c @@ -49,7 +49,8 @@ catfile(const char *pathname, long delay) tv.tv_usec = delay % 1000000; select(0, NULL, NULL, NULL, &tv); c = fgetc(fp); - g_print("%c", c); + fputc(c, stdout); + fflush(stdout); } if (!((pathname == NULL) || (strcmp(pathname, "-") == 0))) { @@ -1344,8 +1344,8 @@ vte_terminal_get_encoding(VteTerminal *terminal) static gboolean vte_terminal_uses_bgfx(VteTerminal *terminal) { - return (terminal->pvt->bg_transparent || - GDK_IS_PIXMAP(terminal->pvt->bg_image)); + return ((terminal->pvt->bg_transparent) || + (terminal->pvt->bg_image != NULL)); } /* End alternate character set. */ @@ -1372,16 +1372,14 @@ vte_sequence_handler_al(VteTerminal *terminal, g_return_if_fail(VTE_IS_TERMINAL(terminal)); widget = GTK_WIDGET(terminal); screen = terminal->pvt->screen; + start = screen->cursor_current.row; if (screen->scrolling_restricted) { - start = screen->insert_delta + screen->scrolling_region.start; end = screen->insert_delta + screen->scrolling_region.end; } else { - start = screen->insert_delta; end = screen->insert_delta + terminal->row_count - 1; } vte_remove_line_int(terminal, end); - vte_insert_line_int(terminal, screen->cursor_current.row); - screen->cursor_current.row++; + vte_insert_line_int(terminal, start); /* Redraw the affected region. */ if (vte_terminal_uses_bgfx(terminal) || 1) { vte_invalidate_cells(terminal, @@ -1833,19 +1831,22 @@ vte_sequence_handler_dl(VteTerminal *terminal, GValueArray *params) { VteScreen *screen; - long end; + long start, end; g_return_if_fail(VTE_IS_TERMINAL(terminal)); screen = terminal->pvt->screen; + start = screen->cursor_current.row; if (screen->scrolling_restricted) { end = screen->insert_delta + screen->scrolling_region.end; } else { end = screen->insert_delta + terminal->row_count - 1; } - vte_remove_line_int(terminal, screen->cursor_current.row); + vte_remove_line_int(terminal, start); vte_insert_line_int(terminal, end); /* Redraw the affected region. */ if (vte_terminal_uses_bgfx(terminal) || 1) { - vte_invalidate_all(terminal); + vte_invalidate_cells(terminal, + 0, terminal->column_count, + start, end - start + 1); } } @@ -5071,7 +5072,6 @@ vte_terminal_handle_sequence(GtkWidget *widget, } /* We probably need to update the cursor's new position, too. */ - vte_terminal_ensure_cursor(terminal); vte_invalidate_cells(terminal, screen->cursor_current.col, 1, screen->cursor_current.row, 1); |