From a96d7a23389ff869fda42076a30f4d397fd52dd0 Mon Sep 17 00:00:00 2001 From: David Barksdale Date: Fri, 8 Jun 2012 10:13:42 -0500 Subject: Fix hildon_pannable_area_add. Calling gtk_container_add is not the correct way to chain up to GtkBin's container_class->add. This just causes hildon_pannable_area_add to be called again and we're in an infinite loop. In-tree widgets have the lovely convenience function _gtk_bin_add_child but we can't call that so we have to jump through these hoops. --- hildon/hildon-pannable-area.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hildon/hildon-pannable-area.c b/hildon/hildon-pannable-area.c index c58937f..6a2f650 100644 --- a/hildon/hildon-pannable-area.c +++ b/hildon/hildon-pannable-area.c @@ -200,6 +200,8 @@ enum { PROP_LAST }; +static GtkBinClass *bin_class = NULL; + static void hildon_pannable_area_class_init (HildonPannableAreaClass * klass); static void hildon_pannable_area_init (HildonPannableArea * area); static void hildon_pannable_area_get_property (GObject * object, @@ -320,6 +322,7 @@ hildon_pannable_area_class_init (HildonPannableAreaClass * klass) GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass); + bin_class = g_type_class_peek (GTK_TYPE_BIN); g_type_class_add_private (klass, sizeof (HildonPannableAreaPrivate)); @@ -2920,8 +2923,7 @@ hildon_pannable_area_add (GtkContainer *container, GtkWidget *child) g_return_if_fail (gtk_bin_get_child (GTK_BIN (container)) == NULL); - gtk_widget_set_parent (child, GTK_WIDGET (container)); - gtk_container_add (container, child); + GTK_CONTAINER_CLASS (bin_class)->add (container, child); g_signal_connect_after (child, "map-event", G_CALLBACK (hildon_pannable_area_child_mapped), -- cgit v1.2.3-18-g5258