--- a/pidgin/gtkblist.c Mon Jun 14 23:56:27 2021 -0500
+++ b/pidgin/gtkblist.c Mon Jun 14 23:59:42 2021 -0500
@@ -3331,9 +3331,8 @@
-pidgin_blist_query_tooltip_for_node(PidginBuddyList *blist,
- PurpleBlistNode *node, GtkTooltip *tooltip)
+pidgin_blist_query_tooltip_for_node(PurpleBlistNode *node, GtkTooltip *tooltip) @@ -3426,7 +3425,7 @@
gtk_tree_model_get(GTK_TREE_MODEL(blist->treemodel), &iter,
- if (pidgin_blist_query_tooltip_for_node(blist, node, tooltip)) {
+ if (pidgin_blist_query_tooltip_for_node(node, tooltip)) { gtk_tree_view_set_tooltip_row(GTK_TREE_VIEW(widget), tooltip, path);
gtk_tree_path_free(path);
--- a/pidgin/gtkblist.h Mon Jun 14 23:56:27 2021 -0500
+++ b/pidgin/gtkblist.h Mon Jun 14 23:59:42 2021 -0500
@@ -425,6 +425,19 @@
void pidgin_blist_draw_tooltip(PurpleBlistNode *node, GtkWidget *widget);
+ * pidgin_blist_query_tooltip_for_node: + * @node: The buddy list to query a tooltip for. + * @tooltip: The tooltip object to add a tooltip to. + * Queries and creates a custom tooltip for a buddy list node. + * Returns: %TRUE if a custom tooltip was added, %FALSE otherwise. +gboolean pidgin_blist_query_tooltip_for_node(PurpleBlistNode *node, GtkTooltip *tooltip); * pidgin_blist_tooltip_destroy:
* Destroys the current (if any) Buddy List tooltip
--- a/pidgin/gtkconv.c Mon Jun 14 23:56:27 2021 -0500
+++ b/pidgin/gtkconv.c Mon Jun 14 23:59:42 2021 -0500
@@ -1384,9 +1384,6 @@
curconv = gtk_notebook_get_current_page(GTK_NOTEBOOK(win->notebook));
- /* clear any tooltips */
- pidgin_tooltip_destroy();
/* If CTRL was held down... */
if (event->state & GDK_CONTROL_MASK) {
@@ -3005,32 +3002,68 @@
-pidgin_conv_userlist_create_tooltip(GtkWidget *tipwindow, GtkTreePath *path,
- gpointer userdata, int *w, int *h)
+pidgin_conv_userlist_query_tooltip(GtkWidget *widget, int x, int y, + gboolean keyboard_mode, GtkTooltip *tooltip, PidginConversation *gtkconv = userdata;
+ PurpleConversation *conv = NULL; + PurpleAccount *account = NULL; + PurpleConnection *connection = NULL; + GtkTreePath *path = NULL; + GtkTreeModel *model = NULL; - GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkconv->u.chat->list));
- PurpleConversation *conv = gtkconv->active_conv;
- PurpleProtocol *protocol;
- PurpleAccount *account = purple_conversation_get_account(conv);
+ PurpleBlistNode *node = NULL; + PurpleProtocol *protocol = NULL; - if (purple_account_get_connection(account) == NULL)
+ conv = gtkconv->active_conv; + account = purple_conversation_get_account(conv); + connection = purple_account_get_connection(account); + if (!PURPLE_IS_CONNECTION(connection)) {
- if (!gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, path))
- gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, CHAT_USERS_NAME_COLUMN, &who, -1);
- protocol = purple_connection_get_protocol(purple_account_get_connection(account));
- node = (PurpleBlistNode*)(purple_blist_find_buddy(purple_conversation_get_account(conv), who));
- if (node && protocol && (purple_protocol_get_options(protocol) & OPT_PROTO_UNIQUE_CHATNAME))
- pidgin_blist_draw_tooltip(node, gtkconv->infopane);
+ model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkconv->u.chat->list)); + GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widget)); + if (!gtk_tree_selection_get_selected(selection, NULL, &iter)) { + path = gtk_tree_model_get_path(GTK_TREE_MODEL(model), &iter); + gtk_tree_view_convert_widget_to_bin_window_coords(GTK_TREE_VIEW(widget), + gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(widget), bx, by, &path, + if (!gtk_tree_model_get_iter(GTK_TREE_MODEL(model), + gtk_tree_path_free(path); + gtk_tree_model_get(model, &iter, CHAT_USERS_NAME_COLUMN, &who, -1); + protocol = purple_connection_get_protocol(connection); + node = (PurpleBlistNode*)purple_blist_find_buddy(account, who); + if (node && protocol && (purple_protocol_get_options(protocol) & OPT_PROTO_UNIQUE_CHATNAME)) { + if (pidgin_blist_query_tooltip_for_node(node, tooltip)) { + gtk_tree_view_set_tooltip_row(GTK_TREE_VIEW(widget), tooltip, path); + gtk_tree_path_free(path); + gtk_tree_path_free(path); @@ -3094,8 +3127,10 @@
G_CALLBACK(gtkconv_chat_popup_menu_cb), gtkconv);
g_signal_connect(G_OBJECT(lbox), "size-allocate", G_CALLBACK(lbox_size_allocate_cb), gtkconv);
- pidgin_tooltip_setup_for_treeview(list, gtkconv,
- pidgin_conv_userlist_create_tooltip, NULL);
+ gtk_widget_set_has_tooltip(list, TRUE); + g_signal_connect(list, "query-tooltip", + G_CALLBACK(pidgin_conv_userlist_query_tooltip), rend = gtk_cell_renderer_text_new();