From c361bdca6afdc933eeac35732334464990295cd4 Mon Sep 17 00:00:00 2001 From: Paul Wise Date: Sat, 6 Oct 2018 10:52:28 +0800 Subject: Add a channel context menu item to focus channels --- src/fe-gtk/menu.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/fe-gtk') 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 @@ -1001,6 +1001,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) { @@ -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, -- cgit 1.4.1