[vte/vte-0-34] emulation: Redraw when changing colours
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/vte-0-34] emulation: Redraw when changing colours
- Date: Sun, 16 Jun 2013 21:32:13 +0000 (UTC)
commit acc863ef287284e9e52c1b96d7e704d6c159d4dd
Author: Christian Persch <chpe gnome org>
Date: Sun Jun 16 22:15:10 2013 +0200
emulation: Redraw when changing colours
https://bugzilla.gnome.org/show_bug.cgi?id=702415
src/vte-private.h | 3 +++
src/vte.c | 23 ++++++++++++-----------
src/vteseq.c | 4 +---
3 files changed, 16 insertions(+), 14 deletions(-)
---
diff --git a/src/vte-private.h b/src/vte-private.h
index fb8c625..0491807 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -437,6 +437,9 @@ void _vte_terminal_cleanup_tab_fragments_at_cursor (VteTerminal *terminal);
void _vte_terminal_audible_beep(VteTerminal *terminal);
void _vte_terminal_visible_beep(VteTerminal *terminal);
void _vte_terminal_beep(VteTerminal *terminal);
+void _vte_terminal_set_color_internal(VteTerminal *terminal,
+ int idx,
+ const GdkColor *color);
void _vte_terminal_inline_error_message(VteTerminal *terminal, const char *format, ...) G_GNUC_PRINTF(2,3);
diff --git a/src/vte.c b/src/vte.c
index 7dbecf5..9776125 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -2500,9 +2500,10 @@ vte_terminal_new(void)
}
/* Set up a palette entry with a more-or-less match for the requested color. */
-static void
-vte_terminal_set_color_internal(VteTerminal *terminal, int entry,
- const GdkColor *proposed)
+void
+_vte_terminal_set_color_internal(VteTerminal *terminal,
+ int entry,
+ const GdkColor *proposed)
{
PangoColor *color;
@@ -2604,7 +2605,7 @@ vte_terminal_set_color_bold(VteTerminal *terminal, const GdkColor *bold)
_vte_debug_print(VTE_DEBUG_MISC,
"Set bold color to (%04x,%04x,%04x).\n",
bold->red, bold->green, bold->blue);
- vte_terminal_set_color_internal(terminal, VTE_BOLD_FG, bold);
+ _vte_terminal_set_color_internal(terminal, VTE_BOLD_FG, bold);
}
/**
@@ -2623,7 +2624,7 @@ vte_terminal_set_color_dim(VteTerminal *terminal, const GdkColor *dim)
_vte_debug_print(VTE_DEBUG_MISC,
"Set dim color to (%04x,%04x,%04x).\n",
dim->red, dim->green, dim->blue);
- vte_terminal_set_color_internal(terminal, VTE_DIM_FG, dim);
+ _vte_terminal_set_color_internal(terminal, VTE_DIM_FG, dim);
}
/**
@@ -2643,7 +2644,7 @@ vte_terminal_set_color_foreground(VteTerminal *terminal,
_vte_debug_print(VTE_DEBUG_MISC,
"Set foreground color to (%04x,%04x,%04x).\n",
foreground->red, foreground->green, foreground->blue);
- vte_terminal_set_color_internal(terminal, VTE_DEF_FG, foreground);
+ _vte_terminal_set_color_internal(terminal, VTE_DEF_FG, foreground);
}
/**
@@ -2665,7 +2666,7 @@ vte_terminal_set_color_background(VteTerminal *terminal,
_vte_debug_print(VTE_DEBUG_MISC,
"Set background color to (%04x,%04x,%04x).\n",
background->red, background->green, background->blue);
- vte_terminal_set_color_internal(terminal, VTE_DEF_BG, background);
+ _vte_terminal_set_color_internal(terminal, VTE_DEF_BG, background);
}
/**
@@ -2691,7 +2692,7 @@ vte_terminal_set_color_cursor(VteTerminal *terminal,
cursor_background->red,
cursor_background->green,
cursor_background->blue);
- vte_terminal_set_color_internal(terminal, VTE_CUR_BG,
+ _vte_terminal_set_color_internal(terminal, VTE_CUR_BG,
cursor_background);
terminal->pvt->cursor_color_set = TRUE;
} else {
@@ -2724,7 +2725,7 @@ vte_terminal_set_color_highlight(VteTerminal *terminal,
highlight_background->red,
highlight_background->green,
highlight_background->blue);
- vte_terminal_set_color_internal(terminal, VTE_DEF_HL,
+ _vte_terminal_set_color_internal(terminal, VTE_DEF_HL,
highlight_background);
terminal->pvt->highlight_color_set = TRUE;
} else {
@@ -2865,7 +2866,7 @@ vte_terminal_set_colors(VteTerminal *terminal,
}
/* Set up the color entry. */
- vte_terminal_set_color_internal(terminal, i, &color);
+ _vte_terminal_set_color_internal(terminal, i, &color);
}
/* Track that we had a color palette set. */
@@ -9099,7 +9100,7 @@ vte_terminal_realize(GtkWidget *widget)
color.green = terminal->pvt->palette[i].green;
color.blue = terminal->pvt->palette[i].blue;
color.pixel = 0;
- vte_terminal_set_color_internal(terminal, i, &color);
+ _vte_terminal_set_color_internal(terminal, i, &color);
}
/* Set up input method support. FIXME: do we need to handle the
diff --git a/src/vteseq.c b/src/vteseq.c
index efd28ac..aacd21f 100644
--- a/src/vteseq.c
+++ b/src/vteseq.c
@@ -1861,9 +1861,7 @@ vte_sequence_handler_change_color (VteTerminal *terminal, GValueArray *params)
continue;
if (vte_parse_color (pairs[i + 1], &color)) {
- terminal->pvt->palette[idx].red = color.red;
- terminal->pvt->palette[idx].green = color.green;
- terminal->pvt->palette[idx].blue = color.blue;
+ _vte_terminal_set_color_internal(terminal, idx, &color);
} else if (strcmp (pairs[i + 1], "?") == 0) {
gchar buf[128];
g_snprintf (buf, sizeof (buf),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]