diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2008-08-27 21:04:43 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-08-27 21:04:43 +0800 |
commit | 8e469695ba831e673aa3fbbd856a5e2495f75089 (patch) | |
tree | a56cb360530edad2a5b58d8c9ca457309a98c1a1 | |
parent | c412bfd8dcda3e13f78ce7212fcda7853280a843 (diff) | |
download | gsoc2013-empathy-8e469695ba831e673aa3fbbd856a5e2495f75089.tar gsoc2013-empathy-8e469695ba831e673aa3fbbd856a5e2495f75089.tar.gz gsoc2013-empathy-8e469695ba831e673aa3fbbd856a5e2495f75089.tar.bz2 gsoc2013-empathy-8e469695ba831e673aa3fbbd856a5e2495f75089.tar.lz gsoc2013-empathy-8e469695ba831e673aa3fbbd856a5e2495f75089.tar.xz gsoc2013-empathy-8e469695ba831e673aa3fbbd856a5e2495f75089.tar.zst gsoc2013-empathy-8e469695ba831e673aa3fbbd856a5e2495f75089.zip |
Keep a ref to the tooltip_widget so it is not recreated all the time.
svn path=/trunk/; revision=1395
-rw-r--r-- | libempathy-gtk/empathy-contact-list-view.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c index 2d6b1703f..97fd84d16 100644 --- a/libempathy-gtk/empathy-contact-list-view.c +++ b/libempathy-gtk/empathy-contact-list-view.c @@ -114,6 +114,19 @@ static guint signals[LAST_SIGNAL]; G_DEFINE_TYPE (EmpathyContactListView, empathy_contact_list_view, GTK_TYPE_TREE_VIEW); +static void +contact_list_view_tooltip_destroy_cb (GtkWidget *widget, + EmpathyContactListView *view) +{ + EmpathyContactListViewPriv *priv = GET_PRIV (view); + + if (priv->tooltip_widget) { + DEBUG ("Tooltip destroyed"); + g_object_unref (priv->tooltip_widget); + priv->tooltip_widget = NULL; + } +} + static gboolean contact_list_view_query_tooltip_cb (EmpathyContactListView *view, gint x, @@ -152,8 +165,10 @@ contact_list_view_query_tooltip_cb (EmpathyContactListView *view, if (!priv->tooltip_widget) { priv->tooltip_widget = empathy_contact_widget_new (contact, EMPATHY_CONTACT_WIDGET_FOR_TOOLTIP); - g_object_add_weak_pointer (G_OBJECT (priv->tooltip_widget), - (gpointer) &priv->tooltip_widget); + g_object_ref (priv->tooltip_widget); + g_signal_connect (priv->tooltip_widget, "destroy", + G_CALLBACK (contact_list_view_tooltip_destroy_cb), + view); } else { empathy_contact_widget_set_contact (priv->tooltip_widget, contact); @@ -966,6 +981,9 @@ contact_list_view_finalize (GObject *object) if (priv->store) { g_object_unref (priv->store); } + if (priv->tooltip_widget) { + g_object_unref (priv->tooltip_widget); + } G_OBJECT_CLASS (empathy_contact_list_view_parent_class)->finalize (object); } |