+static gboolean
+contact_list_view_query_tooltip_cb (EmpathyContactListView *view,
+ gint x,
+ gint y,
+ gboolean keyboard_mode,
+ GtkTooltip *tooltip,
+ gpointer user_data)
+{
+ EmpathyContactListViewPriv *priv = GET_PRIV (view);
+ EmpathyContact *contact;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ GtkTreePath *path;
+
+ /* FIXME: We need GTK version >= 2.12.10. See GNOME bug #504087 */
+ if (gtk_check_version (2, 12, 10)) {
+ return FALSE;
+ }
+
+ if (!gtk_tree_view_get_tooltip_context (GTK_TREE_VIEW (view), &x, &y,
+ keyboard_mode,
+ &model, &path, &iter)) {
+ return FALSE;
+ }
+
+ gtk_tree_view_set_tooltip_row (GTK_TREE_VIEW (view), tooltip, path);
+ gtk_tree_path_free (path);
+
+ gtk_tree_model_get (model, &iter,
+ EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, &contact,
+ -1);
+ if (!contact) {
+ return FALSE;
+ }
+
+ if (!priv->tooltip_widget) {
+ priv->tooltip_widget = empathy_contact_widget_new (contact,
+ EMPATHY_CONTACT_WIDGET_EDIT_NONE);
+ g_object_add_weak_pointer (G_OBJECT (priv->tooltip_widget),
+ (gpointer) &priv->tooltip_widget);
+ } else {
+ empathy_contact_widget_set_contact (priv->tooltip_widget,
+ contact);
+ }
+
+ gtk_tooltip_set_custom (tooltip, priv->tooltip_widget);
+
+ g_object_unref (contact);
+
+ return TRUE;
+}
+