summaryrefslogtreecommitdiffstats
path: root/openembedded/packages/gtkhtml2/files/fix-style-change.patch
blob: 865f2692a83f98daed588d54ae7e90963859620b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Index: libgtkhtml/view/htmlview.c
===================================================================
--- libgtkhtml/view/htmlview.c.orig	2006-02-11 04:45:41.000000000 +0000
+++ libgtkhtml/view/htmlview.c	2006-02-11 04:45:42.000000000 +0000
@@ -2286,9 +2286,7 @@ html_view_realize (GtkWidget *widget)
 	 * GtkLayout uses the bg color for background but we want
 	 * to use base color.
 	 */	
-	widget->style = gtk_style_copy (widget->style);
-	widget->style->bg[GTK_STATE_NORMAL] = 
-		widget->style->base[GTK_STATE_NORMAL];
+	gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, &widget->style->base[GTK_STATE_NORMAL]);
 	/*
 	 * Store the font size so we can adjust size of HtmlFontSpecification
 	 * if the size changes.
@@ -3189,9 +3187,10 @@ html_view_style_set (GtkWidget *widget, 
 				      "focus-line-width", &focus_width,
 				      NULL);
 
-
- 		widget->style->bg[GTK_STATE_NORMAL] =
- 			widget->style->base[GTK_STATE_NORMAL];
+ 		if (!gdk_color_equal (&widget->style->bg[GTK_STATE_NORMAL], &widget->style->base[GTK_STATE_NORMAL])) {
+			gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, &widget->style->base[GTK_STATE_NORMAL]);
+			return;
+ 		}
 		fsize = pango_font_description_get_size (widget->style->font_desc) / (gfloat) PANGO_SCALE;
 		new_isize = (gint) fsize;
 		old_isize = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), "html-view-font-size"));