diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2009-03-08 17:45:27 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2009-03-08 17:45:27 +0800 |
commit | 509345b8a4522318e9a0c8e3a741fc3a5b6b8435 (patch) | |
tree | de83308ee55eac4defce5b54db1e781d3bfbfd9a | |
parent | 78ca357770952c295500c8ab9d844dfac4ec05c0 (diff) | |
download | gsoc2013-empathy-509345b8a4522318e9a0c8e3a741fc3a5b6b8435.tar gsoc2013-empathy-509345b8a4522318e9a0c8e3a741fc3a5b6b8435.tar.gz gsoc2013-empathy-509345b8a4522318e9a0c8e3a741fc3a5b6b8435.tar.bz2 gsoc2013-empathy-509345b8a4522318e9a0c8e3a741fc3a5b6b8435.tar.lz gsoc2013-empathy-509345b8a4522318e9a0c8e3a741fc3a5b6b8435.tar.xz gsoc2013-empathy-509345b8a4522318e9a0c8e3a741fc3a5b6b8435.tar.zst gsoc2013-empathy-509345b8a4522318e9a0c8e3a741fc3a5b6b8435.zip |
Prevent an infinite loop when query tooltip on contact list view.
From: Xavier Claessens <xclaesse@gmail.com>
svn path=/trunk/; revision=2627
-rw-r--r-- | libempathy-gtk/empathy-contact-list-view.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c index b7a6601c6..5df6c8d2a 100644 --- a/libempathy-gtk/empathy-contact-list-view.c +++ b/libempathy-gtk/empathy-contact-list-view.c @@ -141,16 +141,24 @@ contact_list_view_query_tooltip_cb (EmpathyContactListView *view, GtkTreeModel *model; GtkTreeIter iter; GtkTreePath *path; + static gboolean running = FALSE; + gboolean ret = FALSE; + + /* Avoid an infinite loop. See GNOME bug #574377 */ + if (running) { + return FALSE; + } + running = TRUE; /* FIXME: We need GTK version >= 2.12.10. See GNOME bug #504087 */ if (gtk_check_version (2, 12, 10)) { - return FALSE; + goto OUT; } if (!gtk_tree_view_get_tooltip_context (GTK_TREE_VIEW (view), &x, &y, keyboard_mode, &model, &path, &iter)) { - return FALSE; + goto OUT; } gtk_tree_view_set_tooltip_row (GTK_TREE_VIEW (view), tooltip, path); @@ -160,7 +168,7 @@ contact_list_view_query_tooltip_cb (EmpathyContactListView *view, EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, &contact, -1); if (!contact) { - return FALSE; + goto OUT; } if (!priv->tooltip_widget) { @@ -176,10 +184,13 @@ contact_list_view_query_tooltip_cb (EmpathyContactListView *view, } gtk_tooltip_set_custom (tooltip, priv->tooltip_widget); + ret = TRUE; g_object_unref (contact); +OUT: + running = FALSE; - return TRUE; + return ret; } static void |