[hotssh] Focus the host entry by default



commit 66d40c4d83421f6fc48c4fa63304fd544a02bfd0
Author: Colin Walters <walters verbum org>
Date:   Wed Nov 6 20:23:51 2013 -0500

    Focus the host entry by default

 src/hotssh-tab.c |    8 ++++++++
 src/hotssh-win.c |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/hotssh-tab.c b/src/hotssh-tab.c
index d03072e..936f968 100644
--- a/src/hotssh-tab.c
+++ b/src/hotssh-tab.c
@@ -549,6 +549,12 @@ on_terminal_size_allocate (GtkWidget    *widget,
 }
 
 static void
+hotssh_tab_grab_focus (GtkWidget *widget)
+{
+  reset_focus_state ((HotSshTab*)widget);
+}
+
+static void
 hotssh_tab_init (HotSshTab *self)
 {
   HotSshTabPrivate *priv = hotssh_tab_get_instance_private (self);
@@ -605,6 +611,8 @@ hotssh_tab_class_init (HotSshTabClass *class)
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), HotSshTab, approve_hostkey_button);
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), HotSshTab, disconnect_button);
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), HotSshTab, terminal_box);
+
+  GTK_WIDGET_CLASS (class)->grab_focus = hotssh_tab_grab_focus;
 }
 
 HotSshTab *
diff --git a/src/hotssh-win.c b/src/hotssh-win.c
index c915a74..10ad3a1 100644
--- a/src/hotssh-win.c
+++ b/src/hotssh-win.c
@@ -151,6 +151,8 @@ hotssh_win_append_tab (HotSshWindow   *self, gboolean new_channel)
                            (GtkWidget*)label);
 
   gtk_widget_show_all (priv->main_notebook);
+
+  gtk_widget_grab_focus ((GtkWidget*)tab);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]