Use treeview for popup menu in buddy list also.

Sat, 09 Sep 2017 05:48:09 -0400

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Sat, 09 Sep 2017 05:48:09 -0400
changeset 38711
76aea257b1c6
parent 38710
32c5e0e741e1
child 38712
ea49cd76cf47

Use treeview for popup menu in buddy list also.

pidgin/gtkblist.c file | annotate | diff | comparison | revisions
--- a/pidgin/gtkblist.c	Sat Sep 09 05:41:58 2017 -0400
+++ b/pidgin/gtkblist.c	Sat Sep 09 05:48:09 2017 -0400
@@ -1868,7 +1868,7 @@
 }
 
 static gboolean
-pidgin_blist_show_context_menu(PurpleBlistNode *node, GdkEvent *event)
+pidgin_blist_show_context_menu(GtkWidget *tv, PurpleBlistNode *node, GdkEvent *event)
 {
 	struct _pidgin_blist_node *gtknode = purple_blist_node_get_ui_data(node);
 	GtkWidget *menu = NULL;
@@ -1911,7 +1911,13 @@
 	/* Now display the menu */
 	if (menu != NULL) {
 		gtk_widget_show_all(menu);
-		gtk_menu_popup_at_pointer(GTK_MENU(menu), event);
+		if (event != NULL) {
+			/* Pointer event */
+			gtk_menu_popup_at_pointer(GTK_MENU(menu), event);
+		} else {
+			/* Keyboard event */
+			pidgin_menu_popup_at_treeview_selection(menu, tv);
+		}
 		handled = TRUE;
 	}
 
@@ -1938,7 +1944,7 @@
 
 	/* Right click draws a context menu */
 	if (gdk_event_triggers_context_menu((GdkEvent *)event)) {
-		handled = pidgin_blist_show_context_menu(node, (GdkEvent *)event);
+		handled = pidgin_blist_show_context_menu(tv, node, (GdkEvent *)event);
 
 	/* CTRL+middle click expands or collapse a contact */
 	} else if ((event->button == 2) && (event->type == GDK_BUTTON_PRESS) &&
@@ -2001,7 +2007,7 @@
 	gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &node, -1);
 
 	/* Shift+F10 draws a context menu */
-	handled = pidgin_blist_show_context_menu(node, NULL);
+	handled = pidgin_blist_show_context_menu(tv, node, NULL);
 
 	return handled;
 }
@@ -7484,7 +7490,7 @@
 
 	if(gtknode->recent_signonoff_timer > 0)
 		g_source_remove(gtknode->recent_signonoff_timer);
-	
+
 	g_object_ref(buddy);
 	gtknode->recent_signonoff_timer = g_timeout_add_seconds(10,
 			(GSourceFunc)buddy_signonoff_timeout_cb, buddy);

mercurial