summaryrefslogtreecommitdiff
path: root/gtk/gtkdrawingarea.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2015-07-20 08:13:35 -0700
committerCosimo Cecchi <cosimoc@gnome.org>2015-07-20 08:43:08 -0700
commit90d237ced46023e3feb8743831966feaa8432397 (patch)
treed4818169c9a35373983b84062be43fecbc43ef3f /gtk/gtkdrawingarea.c
parent11ce41d9c423a5339e4e4c4c41a5db20c48e33f0 (diff)
downloadgtk+-90d237ced46023e3feb8743831966feaa8432397.tar.gz
Revert "drawingarea: don't call gtk_style_context_set_background()"
This reverts commit 6786c9d724ad57ea30e169d2afcb4a314b2e56bb. https://bugzilla.gnome.org/show_bug.cgi?id=752599
Diffstat (limited to 'gtk/gtkdrawingarea.c')
-rw-r--r--gtk/gtkdrawingarea.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/gtk/gtkdrawingarea.c b/gtk/gtkdrawingarea.c
index 94034059e1..a9b659ee1c 100644
--- a/gtk/gtkdrawingarea.c
+++ b/gtk/gtkdrawingarea.c
@@ -25,9 +25,9 @@
#include "config.h"
#include "gtkdrawingarea.h"
#include "gtkintl.h"
-#include "gtkrender.h"
#include "gtkstylecontext.h"
+
/**
* SECTION:gtkdrawingarea
* @Short_description: A widget for custom user interface elements
@@ -112,8 +112,6 @@
* gtk_render_focus() for one way to draw focus.
*/
-static gboolean gtk_drawing_area_draw (GtkWidget *widget,
- cairo_t *cr);
static void gtk_drawing_area_realize (GtkWidget *widget);
static void gtk_drawing_area_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
@@ -128,7 +126,6 @@ gtk_drawing_area_class_init (GtkDrawingAreaClass *class)
widget_class->realize = gtk_drawing_area_realize;
widget_class->size_allocate = gtk_drawing_area_size_allocate;
- widget_class->draw = gtk_drawing_area_draw;
gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_DRAWING_AREA);
}
@@ -184,6 +181,9 @@ gtk_drawing_area_realize (GtkWidget *widget)
&attributes, attributes_mask);
gtk_widget_register_window (widget, window);
gtk_widget_set_window (widget, window);
+
+ gtk_style_context_set_background (gtk_widget_get_style_context (widget),
+ window);
}
gtk_drawing_area_send_configure (GTK_DRAWING_AREA (widget));
@@ -209,19 +209,6 @@ gtk_drawing_area_size_allocate (GtkWidget *widget,
}
}
-static gboolean
-gtk_drawing_area_draw (GtkWidget *widget,
- cairo_t *cr)
-{
- if (gtk_widget_get_has_window (widget))
- 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_drawing_area_parent_class)->draw (widget, cr);
-}
-
static void
gtk_drawing_area_send_configure (GtkDrawingArea *darea)
{