[gtk+/wip/background-rework: 6/25] layout: don't call gtk_style_context_set_background()
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/background-rework: 6/25] layout: don't call gtk_style_context_set_background()
- Date: Wed, 1 Jul 2015 18:26:36 +0000 (UTC)
commit 8ebe060040b2e9b1bf58f97a5b96a219a7ee5611
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Jun 3 18:16:33 2015 -0700
layout: don't call gtk_style_context_set_background()
gtk/gtklayout.c | 23 ++++++-----------------
1 files changed, 6 insertions(+), 17 deletions(-)
---
diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c
index dd8f68e..837b690 100644
--- a/gtk/gtklayout.c
+++ b/gtk/gtklayout.c
@@ -36,6 +36,7 @@
#include "gtkintl.h"
#include "gtkmarshalers.h"
#include "gtkprivate.h"
+#include "gtkrender.h"
#include "gtkscrollable.h"
@@ -155,7 +156,6 @@ static void gtk_layout_allocate_child (GtkLayout *layout,
GtkLayoutChild *child);
static void gtk_layout_adjustment_changed (GtkAdjustment *adjustment,
GtkLayout *layout);
-static void gtk_layout_style_updated (GtkWidget *widget);
static void gtk_layout_set_hadjustment_values (GtkLayout *layout);
static void gtk_layout_set_vadjustment_values (GtkLayout *layout);
@@ -692,7 +692,6 @@ gtk_layout_class_init (GtkLayoutClass *class)
widget_class->get_preferred_height = gtk_layout_get_preferred_height;
widget_class->size_allocate = gtk_layout_size_allocate;
widget_class->draw = gtk_layout_draw;
- widget_class->style_updated = gtk_layout_style_updated;
container_class->add = gtk_layout_add;
container_class->remove = gtk_layout_remove;
@@ -903,7 +902,6 @@ gtk_layout_realize (GtkWidget *widget)
priv->bin_window = gdk_window_new (window,
&attributes, attributes_mask);
gtk_widget_register_window (widget, priv->bin_window);
- gtk_style_context_set_background (gtk_widget_get_style_context (widget), priv->bin_window);
tmp_list = priv->children;
while (tmp_list)
@@ -916,20 +914,6 @@ gtk_layout_realize (GtkWidget *widget)
}
static void
-gtk_layout_style_updated (GtkWidget *widget)
-{
- GtkLayoutPrivate *priv;
-
- GTK_WIDGET_CLASS (gtk_layout_parent_class)->style_updated (widget);
-
- if (gtk_widget_get_realized (widget))
- {
- priv = GTK_LAYOUT (widget)->priv;
- gtk_style_context_set_background (gtk_widget_get_style_context (widget), priv->bin_window);
- }
-}
-
-static void
gtk_layout_map (GtkWidget *widget)
{
GtkLayout *layout = GTK_LAYOUT (widget);
@@ -1026,6 +1010,11 @@ gtk_layout_draw (GtkWidget *widget,
GtkLayout *layout = GTK_LAYOUT (widget);
GtkLayoutPrivate *priv = layout->priv;
+ gtk_render_background (gtk_widget_get_style_context (widget), cr,
+ 0, 0,
+ gtk_widget_get_allocated_width (widget),
+ gtk_widget_get_allocated_height (widget));
+
if (gtk_cairo_should_draw_window (cr, priv->bin_window))
GTK_WIDGET_CLASS (gtk_layout_parent_class)->draw (widget, cr);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]