From b5ee44b419a5daa01605af8cd419b03d9e21926c Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Fri, 1 Mar 2013 12:23:59 +0100 Subject: [PATCH] TextView: Properly render background We always need to render the background, as the window background is not always set (i.e. during gtk_widget_draw()) or when its partially visible. https://bugzilla.gnome.org/show_bug.cgi?id=694925 --- gtk/gtktextview.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 5845aae439..48b6441a33 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -5153,9 +5153,22 @@ gtk_text_view_draw (GtkWidget *widget, { GSList *tmp_list; GdkWindow *window; - + GtkStyleContext *context; + + context = gtk_widget_get_style_context (widget); + if (gtk_cairo_should_draw_window (cr, gtk_widget_get_window (widget))) - gtk_text_view_draw_focus (widget, cr); + { + gtk_style_context_save (context); + gtk_style_context_add_class (context, GTK_STYLE_CLASS_VIEW); + gtk_render_background (context, cr, + 0, 0, + gtk_widget_get_allocated_width (widget), + gtk_widget_get_allocated_height (widget)); + gtk_style_context_restore (context); + + gtk_text_view_draw_focus (widget, cr); + } window = gtk_text_view_get_window (GTK_TEXT_VIEW (widget), GTK_TEXT_WINDOW_TEXT);