From 97698ad1c91306e378ca7dec2d5b2009c97536e5 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Fri, 10 Mar 2017 07:57:55 -0300 Subject: [PATCH] week-header: use a proper function to queue redraw We were using gtk_widget_queue_draw() as a callback to a GTimeoutSource, which expects a boolean return type. This is clearly wrong, and has the chance to cause a segmentation fault. Fix that by passing a function with the apropriate signature. https://bugzilla.gnome.org/show_bug.cgi?id=779823 --- src/views/gcal-week-header.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/views/gcal-week-header.c b/src/views/gcal-week-header.c index 93c8a74a..bfa3ccf3 100644 --- a/src/views/gcal-week-header.c +++ b/src/views/gcal-week-header.c @@ -984,6 +984,14 @@ on_expand_action_activated (GcalWeekHeader *self, header_expand (self); } +static gboolean +on_redraw_timeout_cb (gpointer data) +{ + gtk_widget_queue_draw (data); + + return G_SOURCE_CONTINUE; +} + /* Drawing area content and size */ static gdouble get_weekday_names_height (GtkWidget *widget) @@ -1339,7 +1347,7 @@ gcal_week_header_draw (GtkWidget *widget, if (self->redraw_timeout_id == 0) { self->redraw_timeout_id = g_timeout_add_seconds (5, - (GSourceFunc) gtk_widget_queue_draw, + (GSourceFunc) on_redraw_timeout_cb, self); }