commit 09cf778a827a13d4ac5ce32d51613389b1055739
Author: Vibha Yadav <gtk3@linux-qoy7.site>
Date:   Tue Nov 16 17:16:49 2010 +0530

    Use draw signal instead of expose_event

diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c
index 18a89fa..2fb7bb9 100644
--- a/calendar/gui/e-meeting-time-sel.c
+++ b/calendar/gui/e-meeting-time-sel.c
@@ -115,7 +115,7 @@ static void e_meeting_time_selector_realize (GtkWidget *widget);
 static void e_meeting_time_selector_unrealize (GtkWidget *widget);
 static void e_meeting_time_selector_style_set (GtkWidget *widget,
 					       GtkStyle  *previous_style);
-static gint e_meeting_time_selector_expose_event (GtkWidget *widget,
+static gint e_meeting_time_selector_draw (GtkWidget *widget,
 						  GdkEventExpose *event);
 static void e_meeting_time_selector_draw_shadow (EMeetingTimeSelector *mts);
 static void e_meeting_time_selector_hadjustment_changed (GtkAdjustment *adjustment,
@@ -319,7 +319,7 @@ e_meeting_time_selector_class_init (EMeetingTimeSelectorClass * class)
 	widget_class->realize = e_meeting_time_selector_realize;
 	widget_class->unrealize = e_meeting_time_selector_unrealize;
 	widget_class->style_set = e_meeting_time_selector_style_set;
-	widget_class->expose_event = e_meeting_time_selector_expose_event;
+	widget_class->draw = e_meeting_time_selector_draw;
 
 	g_object_class_install_property (
 		object_class,
@@ -885,7 +885,7 @@ e_meeting_time_selector_add_key_color (EMeetingTimeSelector * mts,
 	gtk_box_pack_start (GTK_BOX (child_hbox), label, TRUE, TRUE, 6);
 	gtk_widget_show (label);
 
-	g_signal_connect (darea, "expose_event",
+	g_signal_connect (darea, "draw",
 			  G_CALLBACK (e_meeting_time_selector_expose_key_color),
 			  color);
 }
@@ -899,7 +899,7 @@ e_meeting_time_selector_expose_key_color (GtkWidget *darea,
 	GtkAllocation allocation;
 	GdkWindow *window;
 	GtkStyle *style;
-        cairo_t *cr;
+        cairo_t *cr, *window_cr;
 
 	style = gtk_widget_get_style (darea);
 	window = gtk_widget_get_window (darea);
@@ -907,8 +907,9 @@ e_meeting_time_selector_expose_key_color (GtkWidget *darea,
 
 	mts = g_object_get_data (G_OBJECT (darea), "data");
 
+        window_cr = gdk_cairo_create (window);
 	gtk_paint_shadow (
-		style, window, GTK_STATE_NORMAL,
+		style, cr, GTK_STATE_NORMAL,
 		GTK_SHADOW_IN, NULL, NULL, 0, 0,
 		allocation.width, allocation.height);
 
@@ -1210,7 +1211,7 @@ e_meeting_time_selector_style_set (GtkWidget *widget,
 
 /* This draws a shadow around the top display and main display. */
 static gint
-e_meeting_time_selector_expose_event (GtkWidget *widget,
+e_meeting_time_selector_draw (GtkWidget *widget,
 				      GdkEventExpose *event)
 {
 	EMeetingTimeSelector *mts;
@@ -1219,8 +1220,8 @@ e_meeting_time_selector_expose_event (GtkWidget *widget,
 
 	e_meeting_time_selector_draw_shadow (mts);
 
-	if (GTK_WIDGET_CLASS (e_meeting_time_selector_parent_class)->expose_event)
-		(*GTK_WIDGET_CLASS (e_meeting_time_selector_parent_class)->expose_event)(widget, event);
+	if (GTK_WIDGET_CLASS (e_meeting_time_selector_parent_class)->draw)
+		(*GTK_WIDGET_CLASS (e_meeting_time_selector_parent_class)->draw)(widget, event);
 
 	return FALSE;
 }
@@ -1230,6 +1231,7 @@ e_meeting_time_selector_draw_shadow (EMeetingTimeSelector *mts)
 {
 	GtkAllocation allocation;
 	GdkWindow *window;
+	cairo_t *cr;
 	GtkStyle *style;
 	gint x, y, w, h;
 
@@ -1243,9 +1245,11 @@ e_meeting_time_selector_draw_shadow (EMeetingTimeSelector *mts)
 	style = gtk_widget_get_style (GTK_WIDGET (mts));
 	window = gtk_widget_get_window (GTK_WIDGET (mts));
 
+	cr = gdk_cairo_create(window);
 	gtk_paint_shadow (
-		style, window, GTK_STATE_NORMAL,
-		GTK_SHADOW_IN, NULL, NULL, NULL, x, y, w, h);
+		style, cr, GTK_STATE_NORMAL,
+		GTK_SHADOW_IN, NULL, NULL, x, y, w, h);
+	cairo_destroy(cr);
 }
 
 /* When the main canvas scrolls, we scroll the other canvases. */
