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



commit e6c9bdc676ccb96041f807d88e9b9b02e800b9cb
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 7796f99..5e3c292 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -7654,7 +7654,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 bb6c9a8..0f63d4d 100644
--- a/src/vteapp.c
+++ b/src/vteapp.c
@@ -569,7 +569,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,
@@ -820,13 +820,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);
 
@@ -958,9 +951,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 b2707d9..b360a5e 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]