summary refs log tree commit diff stats
path: root/src/fe-gtk/menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fe-gtk/menu.c')
-rw-r--r--src/fe-gtk/menu.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/fe-gtk/menu.c b/src/fe-gtk/menu.c
index 097093b4..233715e5 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];
@@ -1018,8 +1030,11 @@ menu_chanmenu (struct session *sess, GdkEventButton * event, char *chan)
 {
 	GtkWidget *menu;
 	int is_joined = FALSE;
+	session * chan_session;
+
+	chan_session = find_channel (sess->server, chan);
 
-	if (find_channel (sess->server, chan))
+	if (chan_session)
 		is_joined = TRUE;
 
 	g_free (str_copy);
@@ -1035,6 +1050,9 @@ menu_chanmenu (struct session *sess, GdkEventButton * event, char *chan)
 												 str_copy);
 	else
 	{
+		if (chan_session != current_sess)
+			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,