[evolution] Restore update method in ECanvasBackground



commit d9d9d7f0efad7a1b4464b541201d922cd373c3f4
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Oct 24 11:22:31 2010 -0400

    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 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/widgets/misc/e-canvas-background.c b/widgets/misc/e-canvas-background.c
index 9fe59f6..80b3bf0 100644
--- a/widgets/misc/e-canvas-background.c
+++ b/widgets/misc/e-canvas-background.c
@@ -76,6 +76,26 @@ ecb_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1, gdouble *x2, gdoubl
 }
 
 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)
 {
 	ECanvasBackground *ecb = E_CANVAS_BACKGROUND (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;



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