[gtk+/multitouch: 119/121] textview: Set background on the widget's window



commit 9116673f235eadd5f000c1ae245379d9b8393c16
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Jan 12 03:05:54 2012 +0100

    textview: Set background on the widget's window
    
    The widget window is usually covered by the bin_window,
    this is just necessary so the parent scrolled window
    picks the right color for drawing the overshoot area.

 gtk/gtktextview.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index fa5cc74..fc0c22e 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -4020,8 +4020,10 @@ gtk_text_view_realize (GtkWidget *widget)
   context = gtk_widget_get_style_context (widget);
   state = gtk_widget_get_state_flags (widget);
 
-  gtk_style_context_get_background_color (context, state, &color);
-  gdk_window_set_background_rgba (window, &color);
+  gtk_style_context_save (context);
+  gtk_style_context_add_class (context, GTK_STYLE_CLASS_VIEW);
+  gtk_style_context_set_background (context, window);
+  gtk_style_context_restore (context);
 
   text_window_realize (priv->text_window, widget);
 
@@ -4121,16 +4123,14 @@ gtk_text_view_set_background (GtkTextView *text_view)
   gtk_style_context_save (context);
   gtk_style_context_add_class (context, GTK_STYLE_CLASS_VIEW);
 
-  gtk_style_context_get_background_color (context, state, &color);
-  gdk_window_set_background_rgba (priv->text_window->bin_window, &color);
+  gtk_style_context_set_background (context, priv->text_window->bin_window);
+  gtk_style_context_set_background (context, gtk_widget_get_window (widget));
 
   gtk_style_context_restore (context);
 
   /* Set lateral panes background */
   gtk_style_context_get_background_color (context, state, &color);
 
-  gdk_window_set_background_rgba (gtk_widget_get_window (widget), &color);
-
   if (priv->left_window)
     gdk_window_set_background_rgba (priv->left_window->bin_window, &color);
 



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