[vte/vte-next] Don't set a default background pattern



commit 976319e45aabcc18dbdadc687735b72f71d3529d
Author: Christian Persch <chpe gnome org>
Date:   Mon May 16 13:24:23 2011 +0200

    Don't set a default background pattern

 src/vte.c     |    2 +-
 src/vteapp.c  |   17 ++++++++---------
 src/vtedraw.c |    8 +++++---
 3 files changed, 14 insertions(+), 13 deletions(-)
---
diff --git a/src/vte.c b/src/vte.c
index b4bb58e..8b5a7a4 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -7656,7 +7656,7 @@ vte_terminal_init(VteTerminal *terminal)
 	pvt->draw = _vte_draw_new();
 
 	/* Set up background information. */
-        pvt->bg_pattern = cairo_pattern_create_rgba (1., 1., 1., .6);
+        pvt->bg_pattern = NULL;
 
 	pvt->selection_block_mode = FALSE;
 	pvt->has_fonts = FALSE;
diff --git a/src/vteapp.c b/src/vteapp.c
index acf598f..3e0db78 100644
--- a/src/vteapp.c
+++ b/src/vteapp.c
@@ -564,7 +564,7 @@ main(int argc, char **argv)
         char *border_width_string = NULL;
         char *css = NULL;
         char *css_file = NULL;
-	GdkRGBA fore, back, highlight, cursor, tint;
+	GdkRGBA fore, back, highlight, cursor;
 	const GOptionEntry options[]={
 		{
 			"background", 'B', 0,
@@ -815,13 +815,6 @@ main(int argc, char **argv)
 
 	highlight.red = highlight.green = highlight.blue = 0.75; highlight.alpha = 1.0;
 	cursor.red = 1.0; cursor.green = cursor.blue = 0.5; cursor.alpha = 1.0;
-        tint.red = tint.green = tint.blue = 1.; tint.alpha = .875;
-
-        if (tint_color_string) {
-                if (!gdk_rgba_parse (&tint, tint_color_string))
-                        g_printerr ("Failed to parse tint color string\n");
-                g_free (tint_color_string);
-        }
 
 	gdk_window_set_debug_updates(debug);
 
@@ -953,9 +946,15 @@ main(int argc, char **argv)
                         g_printerr("Failed to create background pattern\n");
                 }
                 cairo_surface_destroy (surface);
-        } else {
+        } else if (tint_color_string) {
+                GdkRGBA tint;
                 cairo_pattern_t *pattern;
 
+                tint.red = tint.green = tint.blue = 1.; tint.alpha = .875;
+                if (!gdk_rgba_parse (&tint, tint_color_string))
+                        g_printerr ("Failed to parse tint color string\n");
+                g_free (tint_color_string);
+
                 pattern = cairo_pattern_create_rgba (tint.red, tint.green, tint.blue, tint.alpha);
                 vte_terminal_set_background_pattern(terminal, pattern);
                 cairo_pattern_destroy(pattern);
diff --git a/src/vtedraw.c b/src/vtedraw.c
index 7c00dd0..91ca1a5 100644
--- a/src/vtedraw.c
+++ b/src/vtedraw.c
@@ -794,7 +794,8 @@ _vte_draw_set_background_scroll (struct _vte_draw *draw,
 			"draw_set_scroll (%d, %d)\n",
 			x, y);
 
-	g_return_if_fail (draw->bg_pattern != NULL);
+        if (draw->bg_pattern == NULL)
+                return;
 
 	cairo_matrix_init_translate (&matrix, x, y);
 	cairo_pattern_set_matrix (draw->bg_pattern, &matrix);
@@ -803,11 +804,12 @@ _vte_draw_set_background_scroll (struct _vte_draw *draw,
 void
 _vte_draw_clear (struct _vte_draw *draw, gint x, gint y, gint width, gint height)
 {
-	g_return_if_fail (draw->bg_pattern != NULL);
-
 	_vte_debug_print (VTE_DEBUG_DRAW, "draw_clear (%d, %d, %d, %d)\n",
 			  x,y,width, height);
 
+        if (draw->bg_pattern == NULL)
+                return;
+
         g_assert(draw->cr);
         cairo_rectangle (draw->cr, x, y, width, height);
 	cairo_set_operator (draw->cr, CAIRO_OPERATOR_SOURCE);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]