From d9d9d7f0efad7a1b4464b541201d922cd373c3f4 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 24 Oct 2010 11:22:31 -0400 Subject: Restore update method in ECanvasBackground Restore the update() method in ECanvasBackground. Without a redraw request the draw() method is never called. For some reason this isn't noticeable on gtk+-3.0 -- ETable and ETree backgrounds are still white -- but on gtk+-2.0 the backgrounds are grey. --- widgets/misc/e-canvas-background.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'widgets/misc/e-canvas-background.c') diff --git a/widgets/misc/e-canvas-background.c b/widgets/misc/e-canvas-background.c index 9fe59f6feb..80b3bf014e 100644 --- a/widgets/misc/e-canvas-background.c +++ b/widgets/misc/e-canvas-background.c @@ -75,6 +75,26 @@ ecb_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1, gdouble *x2, gdoubl *y2 = G_MAXDOUBLE; } +static void +ecb_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags) +{ + gdouble x1, y1, x2, y2; + + x1 = item->x1; + y1 = item->y1; + x2 = item->x2; + y2 = item->y2; + + /* The bounds are all constants so we should only have to + * redraw once. */ + ecb_bounds (item, &item->x1, &item->y1, &item->x2, &item->y2); + + if (item->x1 != x1 || item->y1 != y1 || + item->x2 != x2 || item->y2 != y2) + gnome_canvas_request_redraw ( + item->canvas, item->x1, item->y1, item->x2, item->y2); +} + static void ecb_dispose (GObject *object) { @@ -217,6 +237,7 @@ ecb_class_init (ECanvasBackgroundClass *ecb_class) object_class->set_property = ecb_set_property; object_class->get_property = ecb_get_property; + item_class->update = ecb_update; item_class->draw = ecb_draw; item_class->point = ecb_point; item_class->bounds = ecb_bounds; -- cgit v1.2.3