summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorPaul Wise <pabs3@bonedaddy.net>2018-10-06 10:52:28 +0800
committerPatrick <tingping@tingping.se>2019-12-30 18:14:53 -0800
commitc361bdca6afdc933eeac35732334464990295cd4 (patch)
treebd08c0e8400b5465de66d4038fb9ec294828a699 /src
parentc522ccce7fd10ccb22ee9dc314256c90232f8601 (diff)
Add a channel context menu item to focus channels
Diffstat (limited to 'src')
-rw-r--r--src/fe-gtk/menu.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/fe-gtk/menu.c b/src/fe-gtk/menu.c
index 097093b4..aba3d745 100644
--- a/src/fe-gtk/menu.c
+++ b/src/fe-gtk/menu.c
@@ -1002,6 +1002,18 @@ menu_chan_part (GtkWidget * menu, char *chan)
 }
 
 static void
+menu_chan_focus (GtkWidget * menu, char *chan)
+{
+	char tbuf[256];
+
+	if (current_sess)
+	{
+		g_snprintf (tbuf, sizeof tbuf, "doat %s gui focus", chan);
+		handle_command (current_sess, tbuf, FALSE);
+	}
+}
+
+static void
 menu_chan_join (GtkWidget * menu, char *chan)
 {
 	char tbuf[256];
@@ -1035,6 +1047,8 @@ menu_chanmenu (struct session *sess, GdkEventButton * event, char *chan)
 												 str_copy);
 	else
 	{
+		menu_quick_item_with_callback (menu_chan_focus, _("Focus Channel"), menu,
+												 str_copy);
 		menu_quick_item_with_callback (menu_chan_part, _("Part Channel"), menu,
 												 str_copy);
 		menu_quick_item_with_callback (menu_chan_cycle, _("Cycle Channel"), menu,