From 6b0f202bf37de2d8489cde1549763895aed3dab4 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Sat, 27 Jun 2015 12:52:58 -0700 Subject: [PATCH] toolpalette: don't call gtk_style_context_set_background() --- gtk/gtktoolpalette.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/gtk/gtktoolpalette.c b/gtk/gtktoolpalette.c index 4d25292b4c..70ca79f9c4 100644 --- a/gtk/gtktoolpalette.c +++ b/gtk/gtktoolpalette.c @@ -740,9 +740,6 @@ gtk_tool_palette_realize (GtkWidget *widget) gtk_widget_set_window (widget, window); gtk_widget_register_window (widget, window); - gtk_style_context_set_background (gtk_widget_get_style_context (widget), - window); - gtk_container_forall (GTK_CONTAINER (widget), (GtkCallback) gtk_widget_set_parent_window, window); @@ -761,6 +758,18 @@ gtk_tool_palette_adjustment_value_changed (GtkAdjustment *adjustment, gtk_tool_palette_size_allocate (widget, &allocation); } +static gboolean +gtk_tool_palette_draw (GtkWidget *widget, + cairo_t *cr) +{ + gtk_render_background (gtk_widget_get_style_context (widget), cr, + 0, 0, + gtk_widget_get_allocated_width (widget), + gtk_widget_get_allocated_height (widget)); + + return GTK_WIDGET_CLASS (gtk_tool_palette_parent_class)->draw (widget, cr); +} + static void gtk_tool_palette_add (GtkContainer *container, GtkWidget *child) @@ -914,6 +923,7 @@ gtk_tool_palette_class_init (GtkToolPaletteClass *cls) wclass->get_preferred_height= gtk_tool_palette_get_preferred_height; wclass->size_allocate = gtk_tool_palette_size_allocate; wclass->realize = gtk_tool_palette_realize; + wclass->draw = gtk_tool_palette_draw; cclass->add = gtk_tool_palette_add; cclass->remove = gtk_tool_palette_remove;